Skip to content

Conversation

@matheus23
Copy link
Member

This fixes a panic for me, when code is using irpc::util::quinn_setup_util::make_insecure_client_endpoint, where configure_client_insecure wouldn't tell rustls which crypto provider to use.

The panic in question
thread 'tokio-runtime-worker' panicked at /home/philipp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.23.31/src/crypto/mod.rs:249:14:

Could not automatically determine the process-level CryptoProvider from Rustls crate features.
Call CryptoProvider::install_default() before this point to select a provider manually, or make sure exactly one of the 'aws-lc-rs' and 'ring' features is enabled.
See the documentation of the CryptoProvider type for more information.
            
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/panicking.rs:75:14
   2: core::panicking::panic_display
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/panicking.rs:269:5
   3: core::option::expect_failed
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/option.rs:2049:5
   4: core::option::Option<T>::expect
             at /home/philipp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:958:21
   5: rustls::crypto::CryptoProvider::get_default_or_install_from_crate_features
             at /home/philipp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.23.31/src/crypto/mod.rs:248:24
   6: rustls::client::client_conn::ClientConfig::builder_with_protocol_versions
             at /home/philipp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.23.31/src/client/client_conn.rs:317:13
   7: rustls::client::client_conn::ClientConfig::builder
             at /home/philipp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.23.31/src/client/client_conn.rs:294:9
   8: irpc::util::quinn_setup_utils::configure_client_insecure
             at /home/philipp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/irpc-0.7.0/src/util.rs:57:22
   9: irpc::util::quinn_setup_utils::non_wasm::make_insecure_client_endpoint
             at /home/philipp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/irpc-0.7.0/src/util.rs:93:30

@matheus23 matheus23 self-assigned this Aug 7, 2025
Comment on lines -25 to +30
let crypto_client_config = rustls::ClientConfig::builder_with_provider(Arc::new(
rustls::crypto::ring::default_provider(),
))
.with_protocol_versions(&[&rustls::version::TLS13])
.expect("valid versions")
.with_root_certificates(certs)
.with_no_client_auth();
let provider = rustls::crypto::ring::default_provider();
let crypto_client_config = rustls::ClientConfig::builder_with_provider(Arc::new(provider))
.with_protocol_versions(&[&rustls::version::TLS13])
.expect("valid versions")
.with_root_certificates(certs)
.with_no_client_auth();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change here, just pulling out let provider for better formatting.

@matheus23 matheus23 requested a review from Frando August 7, 2025 09:44
@matheus23 matheus23 merged commit 9ee8f35 into main Aug 7, 2025
16 checks passed
@matheus23 matheus23 deleted the matheus23/crypto-provider branch August 7, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants