Skip to content

Commit ab69f19

Browse files
authored
add https proxy support (#4253)
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> awslabs/aws-sdk-rust#169 ## Description * Adds support for automatic support for common proxy env vars (`HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY` and their lowercase versions) behind a new `BehaviorVersion` * relocates the TLS providers to their own modules, these are largely the same with the biggest change being `wrap_connector` returns dedicated connector types for `rustls` and `s2n` and the addition of new `connect` modules containing the proxy tunnel logic for each TLS provider. * This results in a bit of repeated logic to handle proxy tunneling but I couldn't find a way to unify the implementations and abstract out just the manual TLS handshake due to type system constraints * updates dependency versions in `aws-smithy-http-client` * added a new `build_with_connector_fn` that allows creating a `SharedHttpClient` by passing your own function for creating connectors. We didn't have a way to configure `aws_smithy_http_client::Connector` and turn it into a `SharedHttpClient` without going through [http_client_fn](https://github.com/smithy-lang/smithy-rs/blob/release-2025-08-04/rust-runtime/aws-smithy-runtime-api/src/client/http.rs#L102). That works but it doesn't re-use the same caching logic for connectors as we do when going through `aws_smithy_http_client::Builder`. The alternative would be to make the client builder in aws-smithy-http-client behavior version aware. Doing it the way it is in the PR allows us to externalize this though and handle it in `aws-smithy-runtime` when creating the [default https client](https://github.com/smithy-lang/smithy-rs/blob/74964aac66ce6833a422d2be446e1aa8d01ba5cc/rust-runtime/aws-smithy-runtime/src/client/http.rs#L87) ## Testing <!--- Please describe in detail how you tested your changes --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> * integration tests with mock proxy over localhost * tested against `mitmproxy` using different combinations of env variables and behavior versions ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "client," "server," or both in the `applies_to` key. - [x] For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "aws-sdk-rust" in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent e4ab0a6 commit ab69f19

File tree

19 files changed

+3116
-271
lines changed

19 files changed

+3116
-271
lines changed

.changelog/1754584273.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
applies_to:
3+
- client
4+
- aws-sdk-rust
5+
authors:
6+
- aajtodd
7+
references:
8+
- aws-sdk-rust#169
9+
breaking: false
10+
new_feature: true
11+
bug_fix: false
12+
---
13+
Add support for proxy environment variables (`HTTP_PROXY, `HTTPS_PROXY`, `ALL_PROXY`, `NO_PROXY`). Service clients will now automatically respect these proxy environment variables on the latest `BehaviorVersion`. Older behavior versions do not automatically detect these environment variables and will require manually building a `aws_smithy_http_client::Connector` with a proxy config explicitly set to use this feature.

aws/rust-runtime/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/rust-runtime/aws-config/Cargo.lock

Lines changed: 19 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/sdk/Cargo.lock

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-runtime/Cargo.lock

Lines changed: 15 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)