Skip to content

Commit

Permalink
Rust: Update for SDK HttpConnector changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther authored and ford-at-aws committed Oct 11, 2023
1 parent 341c6ad commit 5f83d6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rust_dev_preview/examples/tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
10 changes: 5 additions & 5 deletions rust_dev_preview/examples/tls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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?;
Expand Down

0 comments on commit 5f83d6d

Please sign in to comment.