From 767a64a395f8ec5309acc3be98003fe177a56bd6 Mon Sep 17 00:00:00 2001 From: David Souther Date: Tue, 10 Oct 2023 15:39:33 -0400 Subject: [PATCH] Rust: Update for SDK HttpConnector changes. --- rust_dev_preview/examples/tls/Cargo.toml | 2 +- rust_dev_preview/examples/tls/src/lib.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rust_dev_preview/examples/tls/Cargo.toml b/rust_dev_preview/examples/tls/Cargo.toml index 1600814f87c..0f1f08c39fa 100644 --- a/rust_dev_preview/examples/tls/Cargo.toml +++ b/rust_dev_preview/examples/tls/Cargo.toml @@ -13,7 +13,7 @@ path = "src/lib.rs" [dependencies] aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" } -aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" } +aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" } aws-sdk-kms = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", default-features = false } webpki-roots = "0.22.4" tokio = { version = "1.20.1", features = ["full"] } diff --git a/rust_dev_preview/examples/tls/src/lib.rs b/rust_dev_preview/examples/tls/src/lib.rs index 9447cd3e421..47ab6be57c2 100644 --- a/rust_dev_preview/examples/tls/src/lib.rs +++ b/rust_dev_preview/examples/tls/src/lib.rs @@ -15,7 +15,7 @@ This example assumes you have set up environment variables for authentication. */ use aws_sdk_kms::Error; -use aws_smithy_client::hyper_ext; +use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; use rustls::RootCertStore; // snippet-start:[rust.example_code.tls.ConnectWithTLS13] @@ -49,10 +49,10 @@ pub async fn connect_via_tls_13() -> Result<(), Error> { .enable_http2() .build(); - let shared_conf = aws_config::from_env() - .http_connector(hyper_ext::Adapter::builder().build(rustls_connector)) - .load() - .await; + // See https://github.com/awslabs/smithy-rs/discussions/3022 for the HyperClientBuilder + let http_client = HyperClientBuilder::new().build(rustls_connector); + + let shared_conf = aws_config::from_env().http_client(http_client).load().await; let kms_client = aws_sdk_kms::Client::new(&shared_conf); let response = kms_client.list_keys().send().await?;