Skip to content

Commit 7ec6a4b

Browse files
committed
Rust: Update for SDK HttpConnector changes.
1 parent e44e14d commit 7ec6a4b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

rust_dev_preview/examples/tls/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ path = "src/lib.rs"
1313

1414
[dependencies]
1515
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
16-
aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
16+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
1717
aws-sdk-kms = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", default-features = false }
1818
webpki-roots = "0.22.4"
1919
tokio = { version = "1.20.1", features = ["full"] }

rust_dev_preview/examples/tls/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This example assumes you have set up environment variables for authentication.
1515
*/
1616

1717
use aws_sdk_kms::Error;
18-
use aws_smithy_client::hyper_ext;
18+
use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder;
1919
use rustls::RootCertStore;
2020

2121
// snippet-start:[rust.example_code.tls.ConnectWithTLS13]
@@ -49,10 +49,10 @@ pub async fn connect_via_tls_13() -> Result<(), Error> {
4949
.enable_http2()
5050
.build();
5151

52-
let shared_conf = aws_config::from_env()
53-
.http_connector(hyper_ext::Adapter::builder().build(rustls_connector))
54-
.load()
55-
.await;
52+
// See https://github.com/awslabs/smithy-rs/discussions/3022 for the HyperClientBuilder
53+
let http_client = HyperClientBuilder::new().build(rustls_connector);
54+
55+
let shared_conf = aws_config::from_env().http_client(http_client).load().await;
5656

5757
let kms_client = aws_sdk_kms::Client::new(&shared_conf);
5858
let response = kms_client.list_keys().send().await?;

0 commit comments

Comments
 (0)