Skip to content

Commit 056d125

Browse files
committed
refactor: move from native to webpki certs on all platforms
1 parent 416bf00 commit 056d125

4 files changed

Lines changed: 11 additions & 179 deletions

File tree

Cargo.lock

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

core/Cargo.toml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,8 @@ uuid = { version = "1", default-features = false, features = ["v4"] }
7777
data-encoding = "2.9"
7878
flate2 = "1.1"
7979
protobuf-json-mapping = "3.7"
80-
rustls = { version = "0.23", default-features = false, features = [
81-
"ring",
82-
] }
83-
84-
# Eventually, this should use rustls-platform-verifier to unify the platform-specific dependencies
85-
# but currently, hyper-proxy2 and tokio-tungstenite do not support it.
86-
[target.'cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))'.dependencies]
87-
hyper-proxy2 = { version = "0.1", default-features = false, features = [
88-
"rustls",
89-
] }
90-
hyper-rustls = { version = "0.27", default-features = false, features = [
91-
"ring",
92-
"http1",
93-
"logging",
94-
"tls12",
95-
"native-tokio",
96-
"http2",
97-
] }
98-
tokio-tungstenite = { version = "0.27", default-features = false, features = [
99-
"rustls-tls-native-roots",
100-
] }
80+
rustls = { version = "0.23", default-features = false, features = ["ring"] }
10181

102-
[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))'.dependencies]
10382
hyper-proxy2 = { version = "0.1", default-features = false, features = [
10483
"rustls-webpki",
10584
] }

core/src/http_client.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,7 @@ impl HttpClient {
151151
Error::internal(format!("unable to install default crypto provider: {e:?}"))
152152
});
153153

154-
// On supported platforms, use native roots
155-
#[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
156-
let tls = HttpsConnectorBuilder::new().with_native_roots()?;
157-
158-
// Otherwise, use webpki roots
159-
#[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))]
160154
let tls = HttpsConnectorBuilder::new().with_webpki_roots();
161-
162155
let https_connector = tls.https_or_http().enable_http1().enable_http2().build();
163156

164157
// When not using a proxy a dummy proxy is configured that will not intercept any traffic.

oauth/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ edition = "2021"
1111
[dependencies]
1212
log = "0.4"
1313
oauth2 = { version = "5.0", features = ["reqwest", "reqwest-blocking"] }
14-
reqwest = { version = "0.12", features = ["blocking"] }
14+
reqwest = { version = "0.12", default-features = false, features = [
15+
"blocking",
16+
"http2",
17+
"rustls-tls",
18+
"system-proxy",
19+
] }
1520
open = "5.3"
1621
thiserror = "2"
1722
url = "2.5"

0 commit comments

Comments
 (0)