#[cfg(any(
feature = "crypto-aws-lc-rs",
feature = "crypto-ring",
feature = "crypto-openssl",
feature = "crypto-fips",
))]
use std::sync::Once;
#[cfg(feature = "crypto-aws-lc-rs")]
pub(crate) fn install_default_provider() {
static ONCE: Once = Once::new();
ONCE.call_once(|| {
let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
});
}
#[cfg(all(not(feature = "crypto-aws-lc-rs"), feature = "crypto-fips"))]
pub(crate) fn install_default_provider() {
static ONCE: Once = Once::new();
ONCE.call_once(|| {
let _ = rustls::crypto::default_fips_provider().install_default();
});
}
#[cfg(all(
not(any(feature = "crypto-aws-lc-rs", feature = "crypto-fips")),
feature = "crypto-openssl"
))]
pub(crate) fn install_default_provider() {
static ONCE: Once = Once::new();
ONCE.call_once(|| {
let _ = rustls_openssl::default_provider().install_default();
});
}
#[cfg(all(
not(any(
feature = "crypto-aws-lc-rs",
feature = "crypto-fips",
feature = "crypto-openssl"
)),
feature = "crypto-ring"
))]
pub(crate) fn install_default_provider() {
static ONCE: Once = Once::new();
ONCE.call_once(|| {
let _ = rustls::crypto::ring::default_provider().install_default();
});
}
#[cfg(not(any(
feature = "crypto-aws-lc-rs",
feature = "crypto-ring",
feature = "crypto-openssl",
feature = "crypto-fips",
)))]
pub(crate) fn install_default_provider() {}