Skip to content

Commit 34c10bc

Browse files
fix(iroh): ensure passing a crpyto provider to rustls clients (#3169)
## Description This will result in a panic otherwise, if no default crypto provider is setup for rustls. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented.
1 parent fa66d88 commit 34c10bc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

iroh/src/magicsock.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,9 +2609,13 @@ impl Actor {
26092609
// create a client config for the endpoint to use for QUIC address discovery
26102610
let root_store =
26112611
rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
2612-
let client_config = rustls::ClientConfig::builder()
2613-
.with_root_certificates(root_store)
2614-
.with_no_client_auth();
2612+
let client_config = rustls::client::ClientConfig::builder_with_provider(Arc::new(
2613+
rustls::crypto::ring::default_provider(),
2614+
))
2615+
.with_safe_default_protocol_versions()
2616+
.expect("ring supports these")
2617+
.with_root_certificates(root_store)
2618+
.with_no_client_auth();
26152619
let quic_config = Some(QuicConfig {
26162620
ep: self.qad_endpoint.clone(),
26172621
client_config,

0 commit comments

Comments
 (0)