Skip to content

Commit a7569f0

Browse files
committed
f Try one, then the other
1 parent 3330365 commit a7569f0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,9 +1530,10 @@ fn build_with_store_internal(
15301530
fn optionally_install_rustls_cryptoprovider() {
15311531
// Ensure we always install a `CryptoProvider` for `rustls` if it was somehow not previously installed by now.
15321532
if rustls::crypto::CryptoProvider::get_default().is_none() {
1533-
let res_ring = rustls::crypto::ring::default_provider().install_default();
1534-
let res_aws = rustls::crypto::aws_lc_rs::default_provider().install_default();
1535-
debug_assert!(res_ring.is_ok() || res_aws.is_ok(), "We need to install a CryptoProvider");
1533+
let res = rustls::crypto::ring::default_provider()
1534+
.install_default()
1535+
.or(rustls::crypto::aws_lc_rs::default_provider().install_default());
1536+
debug_assert!(res.is_ok(), "We need to install a CryptoProvider");
15361537
}
15371538

15381539
// Refuse to startup without TLS support. Better to catch it now than even later at runtime.

0 commit comments

Comments
 (0)