Skip to content

Commit

Permalink
Refactor the cfg to clarify
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchda committed Nov 1, 2024
1 parent 02e8d4f commit e4e74e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ddcommon/src/connector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ lazy_static! {
// When using aws-lc-rs, rustls needs to be initialized with the default CryptoProvider; sometimes
// this is done as a side-effect of other operations, but we need to ensure it happens here. On
// non-unix platforms, ddcommon uses `ring` instead, which handles this at rustls initialization.
#[cfg(unix)]
#[cfg(feature = "use_webpki_roots")]
lazy_static! {
static ref INIT_CRYPTO_PROVIDER: () = {
#[cfg(unix)]
rustls::crypto::aws_lc_rs::default_provider()
.install_default()
.expect("Failed to install default CryptoProvider");
Expand Down Expand Up @@ -110,6 +110,7 @@ fn build_https_connector_with_webpki_roots(
) -> anyhow::Result<hyper_rustls::HttpsConnector<hyper_util::client::legacy::connect::HttpConnector>>
{
*INIT_CRYPTO_PROVIDER; // One-time initialization of a crypto provider if needed

let client_config = ClientConfig::builder()
.with_webpki_roots()
.with_no_client_auth();
Expand Down

0 comments on commit e4e74e9

Please sign in to comment.