From 2d92113006612988b51ed87c5f88286250ab8162 Mon Sep 17 00:00:00 2001 From: Tianhao Geng Date: Wed, 18 Sep 2024 18:53:52 +0000 Subject: [PATCH] tough-ssm: upgrade to hyper-v1 using aws-smithy-experimental --- Cargo.lock | 1 + tough-ssm/Cargo.toml | 3 ++- tough-ssm/src/client.rs | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6beaa16b0..9197cb43c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3122,6 +3122,7 @@ version = "0.13.0" dependencies = [ "aws-config", "aws-sdk-ssm", + "aws-smithy-experimental", "snafu", "tokio", "tough", diff --git a/tough-ssm/Cargo.toml b/tough-ssm/Cargo.toml index 1a4acefde..f7cdd58c3 100644 --- a/tough-ssm/Cargo.toml +++ b/tough-ssm/Cargo.toml @@ -16,6 +16,7 @@ aws-sdk-rust-rustls = ["aws-config/rustls", "aws-sdk-ssm/rustls"] [dependencies] tough = { version = "0.18", path = "../tough", features = ["http"] } aws-sdk-ssm = "1" -aws-config = "1" +aws-config = { version = "1", default-features = false, features = ["credentials-process"] } +aws-smithy-experimental = { version = "0.1", features = ["crypto-aws-lc"] } snafu = { version = "0.8", features = ["backtraces-impl-backtrace-crate"] } tokio = { version = "1", features = ["fs", "io-util", "time", "macros", "rt-multi-thread"] } diff --git a/tough-ssm/src/client.rs b/tough-ssm/src/client.rs index e926049b5..0fbe5e317 100644 --- a/tough-ssm/src/client.rs +++ b/tough-ssm/src/client.rs @@ -5,6 +5,7 @@ use aws_config::default_provider::credentials::DefaultCredentialsChain; use aws_config::default_provider::region::DefaultRegionChain; use aws_config::BehaviorVersion; use aws_sdk_ssm::Client as SsmClient; +use aws_smithy_experimental::hyper_1_0::{CryptoMode, HyperClientBuilder}; use snafu::ResultExt; use std::thread; @@ -26,7 +27,10 @@ pub(crate) fn build_client(profile: Option<&str>) -> Result { } async fn async_build_client(profile: Option) -> SsmClient { - let config = aws_config::defaults(BehaviorVersion::v2024_03_28()); + let http_client = HyperClientBuilder::new() + .crypto_mode(CryptoMode::AwsLc) // Choose a crypto provider. + .build_https(); + let config = aws_config::defaults(BehaviorVersion::v2024_03_28()).http_client(http_client); let client_config = if let Some(profile) = profile { let region = DefaultRegionChain::builder() .profile_name(&profile)