Skip to content

Commit

Permalink
chore: explicitly configure Rustls default provider (#110)
Browse files Browse the repository at this point in the history
By explicitly setting up Rustls crypto provider, we can now update
`reqwest` without breaking the integration tests, since
it will pick up as default provider.

### References
-
https://github.com/seanmonstar/reqwest/pull/2299/files#diff-0df5342f97493f9f55d6f43a14268f327ea9e791c7fdb8df6d88ec81f6baa721R570-R572
  • Loading branch information
augustoccesar authored Oct 22, 2024
1 parent c5a3017 commit fe1ab05
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 71 deletions.
174 changes: 106 additions & 68 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion linkup-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ log = "0.4.22"
nix = { version = "0.29.0", features = ["signal"] }
rand = "0.8.5"
regex = "1.11.0"
reqwest = { version = "0.12.4", default-features = false, features = [
reqwest = { version = "0.12.8", default-features = false, features = [
"blocking",
"rustls-tls",
] }
Expand Down
2 changes: 1 addition & 1 deletion local-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ hyper-rustls = "0.27.3"
hyper-util = { version = "0.1.9", features = ["client-legacy"] }
futures = "0.3.31"
linkup = { path = "../linkup" }
rustls = "0.23.15"
rustls = { version = "0.23.15", default-features = false, features = ["ring"] }
rustls-native-certs = "0.8.0"
thiserror = "1.0.64"
tokio = { version = "1.40.0", features = ["macros", "signal"] }
Expand Down
2 changes: 2 additions & 0 deletions local-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ async fn shutdown_signal() {
}

fn https_client() -> HttpsClient {
let _ = rustls::crypto::ring::default_provider().install_default();

let mut roots = rustls::RootCertStore::empty();
for cert in rustls_native_certs::load_native_certs().expect("could not load platform certs") {
roots.add(cert).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion server-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
linkup = { path = "../linkup" }
linkup-local-server = { path = "../local-server" }
http = "1.1.0"
reqwest = { version = "0.12.4", default-features = false, features = [
reqwest = { version = "0.12.8", default-features = false, features = [
"blocking",
"rustls-tls",
] }
Expand Down

0 comments on commit fe1ab05

Please sign in to comment.