diff --git a/src/authenticator.rs b/src/authenticator.rs index 45144839b..b1dcd4c77 100644 --- a/src/authenticator.rs +++ b/src/authenticator.rs @@ -579,7 +579,6 @@ impl AuthenticatorBuilder { } fn new(auth_flow: F, hyper_client_builder: C) -> AuthenticatorBuilder { - install_crypto_provider_if_not_set(); AuthenticatorBuilder { hyper_client_builder, storage_type: StorageType::Memory, @@ -1004,7 +1003,7 @@ impl HyperClientBuilder for DefaultHyperClient { ) -> Result, Error> { #[cfg(feature = "hyper-rustls")] let connector = hyper_rustls::HttpsConnectorBuilder::new() - .with_native_roots()? + .with_provider_and_native_roots(rustls::crypto::ring::default_provider())? .https_or_http() .enable_http1() .enable_http2() @@ -1024,7 +1023,7 @@ impl HyperClientBuilder for DefaultHyperClient { ) -> hyper_util::client::legacy::Client { #[cfg(feature = "hyper-rustls")] let connector = hyper_rustls::HttpsConnectorBuilder::new() - .with_native_roots() + .with_provider_and_native_roots(rustls::crypto::ring::default_provider()) .unwrap() .https_or_http() .enable_http1() @@ -1066,16 +1065,6 @@ enum StorageType { Custom(Box), } -#[cfg(feature = "hyper-rustls")] -fn install_crypto_provider_if_not_set() { - if rustls::crypto::CryptoProvider::get_default().is_none() { - let _ = rustls::crypto::ring::default_provider().install_default(); - } -} - -#[cfg(not(feature = "hyper-rustls"))] -fn install_crypto_provider_if_not_set() {} - #[cfg(test)] mod tests { #[test] diff --git a/src/service_account.rs b/src/service_account.rs index 8912d5767..46044ad28 100644 --- a/src/service_account.rs +++ b/src/service_account.rs @@ -243,7 +243,7 @@ mod tests { hyper_util::client::legacy::Client::builder(hyper_util::rt::TokioExecutor::new()) .build( hyper_rustls::HttpsConnectorBuilder::new() - .with_native_roots() + .with_provider_and_native_roots(rustls::crypto::ring::default_provider()) .unwrap() .https_only() .enable_http1()