Skip to content

Commit 0f80933

Browse files
committed
reqwest: Update to 0.13.x
Now rustls-platform-verifier has become the default verifier, so we no longer need to manually set that up.
1 parent ce67498 commit 0f80933

3 files changed

Lines changed: 69 additions & 44 deletions

File tree

Cargo.lock

Lines changed: 67 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ dirs = "6.0.0"
2121
env_logger = "0.11.8"
2222
flate2 = "1.1.5"
2323
log = "0.4.28"
24-
reqwest = { version = "0.12.24", default-features = false, features = ["http2", "charset", "system-proxy", "blocking", "rustls-tls-native-roots"] }
25-
rustls = { version = "0.23.35", default-features = false, features = ["std", "tls12", "ring", "logging"] }
26-
rustls-platform-verifier = "0.6.2"
24+
reqwest = { version = "0.13.1", default-features = false, features = ["http2", "charset", "system-proxy", "blocking", "rustls"] }
2725
serde = { version = "1.0.228", features = ["derive"] }
2826
serde_json = "1.0.145"
2927
serde_yaml_ng = "0.10.0"

src/micromamba/download.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use crate::csmrc::Config;
22

33
use log::{debug, info};
4-
use rustls::ClientConfig;
5-
use rustls_platform_verifier::ConfigVerifierExt;
64
use std::env;
75
use std::error::Error;
86
use std::fmt;
@@ -18,7 +16,6 @@ pub enum DownloadError {
1816
DownloadDisabled,
1917
IO(io::Error),
2018
Reqwest(reqwest::Error),
21-
Rustls(rustls::Error),
2219
}
2320

2421
impl From<io::Error> for DownloadError {
@@ -33,12 +30,6 @@ impl From<reqwest::Error> for DownloadError {
3330
}
3431
}
3532

36-
impl From<rustls::Error> for DownloadError {
37-
fn from(err: rustls::Error) -> Self {
38-
Self::Rustls(err)
39-
}
40-
}
41-
4233
impl fmt::Display for DownloadError {
4334
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4435
match self {
@@ -66,7 +57,6 @@ impl fmt::Display for DownloadError {
6657
}
6758
Ok(())
6859
}
69-
DownloadError::Rustls(e) => write!(f, "TLS (rustls) error: {}", e),
7060
}
7161
}
7262
}
@@ -211,10 +201,9 @@ pub fn download_micromamba(config: &Config) -> Result<PathBuf, DownloadError> {
211201
return Err(DownloadError::DownloadDisabled);
212202
}
213203

214-
let tls_config = ClientConfig::with_platform_verifier()?;
215204
let client = reqwest::blocking::Client::builder()
205+
.tls_backend_rustls()
216206
.timeout(Duration::from_secs(60))
217-
.use_preconfigured_tls(tls_config)
218207
.build()?;
219208
let response_tarbz2 = client.get(url).send()?;
220209
debug!("Download completed, sending it to BzDecoder");

0 commit comments

Comments
 (0)