Repository navigation
fix: select ring crypto provider explicitly for server TLS - #242
Conversation
ServerConfig::builder() relies on rustls' crate-feature auto-detection to pick a crypto provider, which panics when neither or both of the ring and aws-lc-rs features are enabled. In test builds the reqwest dev-dependency enables rustls' aws-lc-rs feature alongside our ring feature, so the server-side TLS path (serve_tls_connection) panicked with 'Could not automatically determine the process-level CryptoProvider'. Build the ServerConfig with an explicit ring provider so it no longer depends on ambiguous crate-feature unification or on a client code path having installed a process-wide default first. Also add an isolated 'https' feature row to the fast CI lane: --all-features masks this failure because a remote client path installs the default provider before the server builds its config, so only an isolated https build reproduces it.
|
@FalkWoldmann this fixes the nightly CI failure. Note this was a pre-existing failure (not related to my changes), so a good validation of the improved CI! |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@FalkWoldmann this one is fairly important- fixes the nightly CI job |
|
Sorry for the late notice! Still ensure if we should commit to |
honestly, this change is just about resolving an existing dependency resolution bug surfaced by the more detailed testing, rather than suggesting any changes to the libraries used |
|
yeah, true since we already default to ring. So this is a different topic |
Problem
The nightly / master-push Feature Matrix (failing run) failed on the
--no-default-features --features httpsand--features https,remotepower-set cells with:serve_tls_connectionbuilds itsServerConfigviaServerConfig::builder(), which uses rustls'get_default_or_install_from_crate_features(). That auto-detection panics unless exactly one of thering/aws-lc-rsrustls features is enabled. In test builds, thereqwestdev-dependency enablesrustls/aws-lc-rswhile ourhttpsfeature enablesrustls/ring, so both providers are compiled in and auto-detection is ambiguous.Fix
Build the
ServerConfigwith an explicitringprovider (builder_with_provider), so the server-side TLS path no longer depends on ambiguous crate-feature unification — mirroring how the client path incommon/http.rsalready installsringexplicitly.Why the fast lane missed it
cargo test --all-featurespasses on the pre-fix code: whenremote/remote-httpsis active, httpmock's own client installs theringprovider as the process-wide default early, so the server builder finds it and never hits the ambiguous path. The bug only surfaces when server TLS runs without a remote client path — i.e. the isolatedhttpscells that only the deep matrix runs.To close that gap pre-merge, this PR also adds an isolated
httpsrow to the fast CI lane's test matrix. It would have caught this specific regression on the dependency-bump PR rather than post-merge on master.Verification
cargo test --no-default-features --features https— all example tests pass (were panicking before)cargo test --no-default-features --features https,remote— passcargo test --all-features— pass (unchanged)