Skip to content
Unverified Commit ab69f196 authored by Aaron Todd's avatar Aaron Todd Committed by GitHub
Browse files

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 -->
https://github.com/awslabs/aws-sdk-rust/issues/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._
parent e4ab0a60
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment