Skip to content

Commit

Permalink
generalized interface
Browse files Browse the repository at this point in the history
  • Loading branch information
squell committed Dec 8, 2023
1 parent 60eb995 commit 6de1c86
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ntp-proto/src/nts_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ impl KeyExchangeClient {
pub fn new(
server_name: String,
tls_config: rustls::ClientConfig,
denied_servers: Vec<String>,
denied_servers: impl IntoIterator<Item = String>,
) -> Result<Self, KeyExchangeError> {
let mut client = Self::new_without_tls_write(server_name, tls_config)?;

Expand Down
4 changes: 2 additions & 2 deletions ntpd/src/daemon/keyexchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub(crate) async fn key_exchange_client_with_denied_servers(
server_name: String,
port: u16,
extra_certificates: &[Certificate],
denied_servers: Vec<String>,
denied_servers: impl IntoIterator<Item = String>,
) -> Result<KeyExchangeResult, KeyExchangeError> {
let socket = tokio::net::TcpStream::connect((server_name.as_str(), port)).await?;
let config = build_client_config(extra_certificates)?;
Expand Down Expand Up @@ -218,7 +218,7 @@ where
io: IO,
server_name: String,
config: rustls::ClientConfig,
denied_servers: Vec<String>,
denied_servers: impl IntoIterator<Item = String>,
) -> Result<Self, KeyExchangeError> {
Ok(Self {
inner: Some(BoundKeyExchangeClientData {
Expand Down
5 changes: 1 addition & 4 deletions ntpd/src/daemon/spawn/nts_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ impl NtsPoolSpawner {
self.config.addr.server_name.clone(),
self.config.addr.port,
&self.config.certificate_authorities,
self.current_peers
.iter()
.map(|peer| peer.remote.clone())
.collect(),
self.current_peers.iter().map(|peer| peer.remote.clone()),
)
.await
{
Expand Down

0 comments on commit 6de1c86

Please sign in to comment.