Skip to content

Commit dfe0885

Browse files
fixup
1 parent a006337 commit dfe0885

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

iroh/bench/src/quinn.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,18 @@ pub async fn connect_client(
7272
let endpoint =
7373
quinn::Endpoint::client(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 0)).unwrap();
7474

75-
let secret_key = iroh::SecretKey::generate(&mut rand::rngs::OsRng);
76-
7775
let mut roots = RootCertStore::empty();
7876
roots.add(server_cert)?;
7977

80-
let client_config = iroh::TlsAuthentication::X509.make_client_config(
81-
&secret_key,
82-
None,
83-
vec![ALPN.to_vec()],
84-
false,
85-
)?;
78+
let provider = rustls::crypto::ring::default_provider();
79+
80+
let crypto = rustls::ClientConfig::builder_with_provider(provider.into())
81+
.with_protocol_versions(&[&rustls::version::TLS13])
82+
.unwrap()
83+
.with_root_certificates(roots)
84+
.with_no_client_auth();
8685

87-
let mut client_config =
88-
quinn::ClientConfig::new(Arc::new(QuicClientConfig::try_from(client_config)?));
86+
let mut client_config = quinn::ClientConfig::new(Arc::new(QuicClientConfig::try_from(crypto)?));
8987
client_config.transport_config(Arc::new(transport_config(opt.max_streams, opt.initial_mtu)));
9088

9189
let connection = endpoint

0 commit comments

Comments
 (0)