Skip to content

Commit 6e3f663

Browse files
authored
Merge branch 'main' into davidpz/drive-by-improvements
2 parents df610f0 + a389ea2 commit 6e3f663

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

CHANGELOG.next.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
1212
# author = "rcoh"
1313

14+
[[smithy-rs]]
15+
message = "Raise the minimum TLS version from 1.0 to 1.2 when using the `native-tls` feature in `aws-smithy-client`."
16+
references = ["smithy-rs#2312"]
17+
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client"}
18+
author = "LukeMathWalker"
19+
1420
[[aws-sdk-rust]]
1521
message = """
1622
Provide a way to retrieve fallback credentials if a call to `provide_credentials` is interrupted. An interrupt can occur when a timeout future is raced against a future for `provide_credentials`, and the former wins the race. A new method, `fallback_on_interrupt` on the `ProvideCredentials` trait, can be used in that case. The following code snippet from `LazyCredentialsCache::provide_cached_credentials` has been updated like so:

rust-runtime/aws-smithy-client/src/lib.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,27 @@ pub mod conns {
7272
}
7373

7474
#[cfg(feature = "rustls")]
75+
/// Return a default HTTPS connector backed by the `rustls` crate.
76+
///
77+
/// It requires a minimum TLS version of 1.2.
78+
/// It allows you to connect to both `http` and `https` URLs.
7579
pub fn https() -> Https {
7680
HTTPS_NATIVE_ROOTS.clone()
7781
}
7882

7983
#[cfg(feature = "native-tls")]
84+
/// Return a default HTTPS connector backed by the `hyper_tls` crate.
85+
///
86+
/// It requires a minimum TLS version of 1.2.
87+
/// It allows you to connect to both `http` and `https` URLs.
8088
pub fn native_tls() -> NativeTls {
81-
hyper_tls::HttpsConnector::new()
89+
let mut tls = hyper_tls::native_tls::TlsConnector::builder();
90+
let tls = tls
91+
.min_protocol_version(Some(hyper_tls::native_tls::Protocol::Tlsv12))
92+
.build()
93+
.unwrap_or_else(|e| panic!("Error while creating TLS connector: {}", e));
94+
let http = hyper::client::HttpConnector::new();
95+
hyper_tls::HttpsConnector::from((http, tls.into()))
8296
}
8397

8498
#[cfg(feature = "native-tls")]

0 commit comments

Comments
 (0)