Skip to content

Commit

Permalink
Merge pull request #1977 from rusoto/hyper-rustls
Browse files Browse the repository at this point in the history
Upgrade hyper-rustls
  • Loading branch information
iliana committed Apr 20, 2022
2 parents 37bac10 + f7c92c3 commit 19924ce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -5,7 +5,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

(Please put changes here.)
- Update `hyper-rustls` to `0.23`

## [0.47.0] - 2021-06-29

Expand Down
2 changes: 1 addition & 1 deletion rusoto/core/Cargo.toml
Expand Up @@ -28,7 +28,7 @@ crc32fast = "1.2"
futures = "0.3"
http = "0.2"
hyper = { version = "0.14", features = ["client", "http1", "http2", "tcp"] }
hyper-rustls = { version = "0.22", optional = true, default-dependencies = false }
hyper-rustls = { version = "0.23", optional = true, default-dependencies = false, features = [ "http1", "http2", "tls12", "logging" ] }
hyper-tls = { version = "0.5.0", optional = true }
lazy_static = "1.4"
log = "0.4"
Expand Down
28 changes: 20 additions & 8 deletions rusoto/core/src/request.rs
Expand Up @@ -223,11 +223,17 @@ impl HttpClient {
#[cfg(feature = "native-tls")]
let connector = HttpsConnector::new();

#[cfg(all(feature = "rustls", not(feature = "rustls-webpki")))]
let connector = HttpsConnector::with_native_roots();
#[cfg(feature = "rustls")]
let connector = {
let builder = crate::tls::HttpsConnectorBuilder::new();

#[cfg(feature = "rustls-webpki")]
let connector = HttpsConnector::with_webpki_roots();
#[cfg(not(feature = "rustls-webpki"))]
let builder = builder.with_native_roots();
#[cfg(feature = "rustls-webpki")]
let builder = builder.with_webpki_roots();

builder.https_only().enable_http2().build()
};

Ok(Self::from_connector(connector))
}
Expand All @@ -237,11 +243,17 @@ impl HttpClient {
#[cfg(feature = "native-tls")]
let connector = HttpsConnector::new();

#[cfg(all(feature = "rustls", not(feature = "rustls-webpki")))]
let connector = HttpsConnector::with_native_roots();
#[cfg(feature = "rustls")]
let connector = {
let builder = crate::tls::HttpsConnectorBuilder::new();

#[cfg(feature = "rustls-webpki")]
let connector = HttpsConnector::with_webpki_roots();
#[cfg(not(feature = "rustls-webpki"))]
let builder = builder.with_native_roots();
#[cfg(feature = "rustls-webpki")]
let builder = builder.with_webpki_roots();

builder.https_only().enable_http2().build()
};

Ok(Self::from_connector_with_config(connector, config))
}
Expand Down

0 comments on commit 19924ce

Please sign in to comment.