diff --git a/src/dfx/src/lib/project/import.rs b/src/dfx/src/lib/project/import.rs index 2360673914..85e1e3d531 100644 --- a/src/dfx/src/lib/project/import.rs +++ b/src/dfx/src/lib/project/import.rs @@ -239,16 +239,8 @@ impl Loader { fn client(&mut self) -> Result<&Client, ProjectError> { if self.client.is_none() { - let tls_config = rustls::ClientConfig::builder() - .with_safe_defaults() - .with_webpki_roots() - .with_no_client_auth(); - - // Advertise support for HTTP/2 - //tls_config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()]; - let client = reqwest::Client::builder() - .use_preconfigured_tls(tls_config) + .use_rustls_tls() .build() .map_err(ProjectError::CouldNotCreateHttpClient)?; self.client = Some(client); diff --git a/src/dfx/src/util/mod.rs b/src/dfx/src/util/mod.rs index 45e3a5e510..5abbef1a0d 100644 --- a/src/dfx/src/util/mod.rs +++ b/src/dfx/src/util/mod.rs @@ -334,13 +334,8 @@ pub async fn download_file_to_path(from: &Url, to: &Path) -> DfxResult { #[context("Failed to download from url: {}.", from)] pub async fn download_file(from: &Url) -> DfxResult> { - let tls_config = rustls::ClientConfig::builder() - .with_safe_defaults() - .with_webpki_roots() - .with_no_client_auth(); - let client = reqwest::Client::builder() - .use_preconfigured_tls(tls_config) + .use_rustls_tls() .build() .context("Could not create HTTP client.")?;