aws-util: migrate AWS SDK HTTP client to hyper 1.x + rustls/aws-lc-rs - #37486
Draft
jasonhernandez wants to merge 1 commit into
Draft
aws-util: migrate AWS SDK HTTP client to hyper 1.x + rustls/aws-lc-rs#37486jasonhernandez wants to merge 1 commit into
jasonhernandez wants to merge 1 commit into
Conversation
Rebuild `src/aws-util`'s AWS SDK HTTP clients on the modern aws-smithy-http-client 1.1.12 `Builder` API with rustls and the aws-lc-rs crypto provider, replacing the legacy hyper-0.14 + hyper-tls/native-tls path (`HyperClientBuilder` + `hyper_tls::HttpsConnector`). This removes the last native-tls consumer in our AWS SDK path: the `hyper-tls = "0.5.0"` direct dependency, along with `hyper-0-14` and `tower-service`, is gone from aws-util, and `hyper-tls@0.5.0` no longer appears anywhere in the workspace. That unblocks the native-tls `deny.toml` ban staged in PR #35952 and completes the deviation flagged in #35947. The SSRF-protecting DNS override is preserved. `MzAwsResolver` now implements smithy's `ResolveDns` instead of a `tower_service::Service<Name>`, still delegating IP resolution to `mz_ore::netio::resolve_address` so `enforce_external_addresses` continues to reject private addresses. Only IP resolution is overridden, the SDK still uses the original hostname for SNI and certificate validation. We select the non-FIPS `aws_lc_rs` provider (the `rustls-aws-lc` feature) to match the rest of the crypto stack. A follow-up flips to `rustls-aws-lc-fips` once the NIST certificate lands. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Final piece of the FIPS 140-3 crypto migration for the AWS SDK path.
src/aws-utilbuilt its AWS SDK HTTP clients on the legacy hyper-0.14 stack withhyper-tls/native-tls (OpenSSL). This was the last native-tls consumer in our AWS SDK path.This PR rebuilds those clients on the modern
aws-smithy-http-client1.1.12BuilderAPI using rustls with the aws-lc-rs crypto provider, matching the rest of the crypto stack.deny.tomlban staged in crypto: add deny.toml bans for old crypto deps #35952:hyper-tls@0.5.0is now gone from the entire workspace, so the ban can land.What changed
http_client()andhttp_client_with_resolver()now useaws_smithy_http_client::Builder::new().tls_provider(tls::Provider::Rustls(CryptoMode::AwsLc))and returnSharedHttpClientviabuild_https()/build_with_resolver().MzAwsResolvernow implements smithy'saws_smithy_runtime_api::client::dns::ResolveDnsinstead oftower_service::Service<Name>. It still delegates IP resolution tomz_ore::netio::resolve_address, preserving the SSRF protection: whenenforce_external_addressesis set, private addresses are rejected. Only IP resolution is overridden; the SDK still uses the original hostname for SNI and TLS certificate validation.hyper-0-14,hyper-tls = "0.5.0",tower-service, and the now-unused directaws-smithy-runtimedep fromsrc/aws-util; addedaws-smithy-http-client. Addedaws-smithy-http-client = { version = "1.1.12", default-features = false, features = ["rustls-aws-lc"] }to the workspace deps.Non-FIPS aws-lc-rs for now
We deliberately use the non-FIPS
aws_lc_rsprovider (rustls-aws-lc), consistent with the rest of the stack. A follow-up flips torustls-aws-lc-fipsonce the NIST certificate lands.Dependency tree: native-tls gone from aws-util
Before,
mz-aws-util's direct dependencies included:After:
hyper-tls@0.5.0no longer appears anywhere in the workspace, andhyper v0.14is gone from aws-util's own subtree. aws-util's client path now resolves throughrustls/hyper-rustls/tokio-rustls/aws-lc-rs/hyper v1.9.Cargo.lock
Re-resolved via
cargo check -p mz-aws-util. No version bumps: the diff only flipsaws-smithy-http-client's feature-selected deps (from the hyper-0.14 path to rustls) and updates aws-util's dependency edges.Test plan
cargo check -p mz-aws-utilcargo check -p mz-aws-util --testscargo check -p mz-storage -p mz-aws-secrets-controller(direct consumers of theSharedHttpClientreturn type)cargo test -p mz-aws-util --lib— all 3 resolver tests pass (rejects loopback when enforced, allows loopback when not enforced, allows public IP when enforced)bin/lint-cargocargo --locked deny check licenses bans sourcescargo fmt -p mz-aws-util🤖 Generated with Claude Code
https://claude.ai/code/session_01Ybr18V2N8x92CK641YAUUP
Part of SEC-217.