Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Feb 3, 2025
1 parent a006337 commit dfe0885
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions iroh/bench/src/quinn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,18 @@ pub async fn connect_client(
let endpoint =
quinn::Endpoint::client(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 0)).unwrap();

let secret_key = iroh::SecretKey::generate(&mut rand::rngs::OsRng);

let mut roots = RootCertStore::empty();
roots.add(server_cert)?;

let client_config = iroh::TlsAuthentication::X509.make_client_config(
&secret_key,
None,
vec![ALPN.to_vec()],
false,
)?;
let provider = rustls::crypto::ring::default_provider();

let crypto = rustls::ClientConfig::builder_with_provider(provider.into())
.with_protocol_versions(&[&rustls::version::TLS13])
.unwrap()
.with_root_certificates(roots)
.with_no_client_auth();

let mut client_config =
quinn::ClientConfig::new(Arc::new(QuicClientConfig::try_from(client_config)?));
let mut client_config = quinn::ClientConfig::new(Arc::new(QuicClientConfig::try_from(crypto)?));
client_config.transport_config(Arc::new(transport_config(opt.max_streams, opt.initial_mtu)));

let connection = endpoint
Expand Down

0 comments on commit dfe0885

Please sign in to comment.