Skip to content

Add support for https proxies #3203

@ag-TJNII

Description

@ag-TJNII

Describe the feature

Ruby 3.4 added support for https proxies in Net::HTTP:

It would be useful to use this to add support for https:// http_proxy arg URLs.

Use Case

This will be needed in environments where a proxy is required to reach the AWS APIs, and the proxy itself requires TLS.

Proposed Solution

Seahorse net_http/connection_pool.rb has a nice http_proxy_parts function that builds out the args so, ignoring compatibility, this should be as simple as adding a 6th, boolean value when http_proxy.scheme == 'https'

Other Information

The main case that makes this a non-trivial implementation is what to do when a user is on a version of Ruby that doesn't support p_use_ssl, but passes a https proxy.

Ruby version Proxy scheme Behavior
< 3.4 http Success
>= 3.4 http Success
< 3.4 https ArgumentError
>= 3.4 http Success

Without special handling the Argument Error will be wrong number of arguments (given 8, expected 1..7) from Net::HTTP.new or something similar but not really useful to the end user.

Given how fresh this support is I recommend detecting this scenario and providing a clear error about support.

On the other hand, the current error is Seahorse::Client::NetworkingError: end of file reached (Seahorse::Client::NetworkingError), which is also opaque, but at least that doesn't look like a code bug.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

3, latest

Environment details (OS name and version, etc.)

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions