Skip to content

Commit f377c87

Browse files
committed
Properly use rustls-platform-verifier with reqwest
1 parent 5b0cf74 commit f377c87

File tree

4 files changed

+23
-89
lines changed

4 files changed

+23
-89
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,13 @@ version = "1.11.1"
501501
[workspace.dependencies.reqwest]
502502
version = "0.12.22"
503503
default-features = false
504-
features = ["http2", "rustls-tls-manual-roots", "charset", "json", "socks"]
504+
features = [
505+
"http2",
506+
"rustls-tls-manual-roots-no-provider",
507+
"charset",
508+
"json",
509+
"socks",
510+
]
505511

506512
# RSA cryptography
507513
[workspace.dependencies.rsa]
@@ -518,7 +524,7 @@ version = "0.15.4"
518524

519525
# TLS stack
520526
[workspace.dependencies.rustls]
521-
version = "0.23.30"
527+
version = "0.23.31"
522528

523529
# PEM parsing for rustls
524530
[workspace.dependencies.rustls-pemfile]

crates/http/src/reqwest.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ impl reqwest::dns::Resolve for TracingResolver {
9191
#[must_use]
9292
pub fn client() -> reqwest::Client {
9393
// TODO: can/should we limit in-flight requests?
94-
let tls_config = rustls::ClientConfig::with_platform_verifier();
94+
95+
// The explicit typing here is because `use_preconfigured_tls` accepts
96+
// `Any`, but wants a `ClientConfig` under the hood. This helps us detect
97+
// breaking changes in the rustls-platform-verifier API.
98+
let tls_config: rustls::ClientConfig =
99+
rustls::ClientConfig::with_platform_verifier().expect("failed to create TLS config");
100+
95101
reqwest::Client::builder()
96102
.dns_resolver(Arc::new(TracingResolver::new()))
97103
.use_preconfigured_tls(tls_config)

deny.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ skip = [
6464
{ name = "indexmap", version = "1.9.3" }, # schemars depends on this old version
6565
{ name = "hashbrown", version = "0.12.3" }, # schemars -> indexmap depends on this old version
6666
{ name = "hashbrown", version = "0.14.5" }, # a few crates depend on this old version
67-
{ name = "socket2", version = "0.5.10" }, # a few crates depend on socket2 0.5
6867
# a few dependencies depend on the 1.x version of thiserror
6968
{ name = "thiserror", version = "1.0.69" },
7069
{ name = "thiserror-impl", version = "1.0.69" },

0 commit comments

Comments
 (0)