Repository navigation
Conversation
Add a new test case to confirm the current behavior. Commit fa68e64 fixed the handling of certificate identity check when connecting to an IP address, but the happy path is currently not covered by the test suite.
Add Net::HTTP#ssl_context to return the SSLContext used for HTTPS connections to allow users to configure it directly. Also change the existing SSL/TLS-related accessors to forward to the SSLContext instance directly rather than storing values in Net::HTTP's instance variables and applying them later in Net::HTTP#start. This avoids inconsistencies between, for example, http.cert_store and http.ssl_context.cert_store. The SSLContext instance is now reused for all connections made by a Net::HTTP instance. As a result, the SSLContext becomes frozen on the first connection attempt, and SSL/TLS-related options can no longer be changed afterward. Although I do not expect this to affect most users, it is technically a breaking change. [Feature #19641]
This reverts commit ae2d83f. The commit is very incomplete and not actually usable.
Add Net::HTTP#proxy_use_ssl= to connect to the proxy server over TLS, and Net::HTTP#proxy_ssl_context to configure the TLS settings. Also enable TLS automatically when the proxy setting taken from the environment variables has the https scheme. Making HTTPS requests through an HTTPS proxy requires ruby/openssl 4.1, which supports nesting OpenSSL::SSL::SSLSocket objects.
This branch has not been deployed
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.
Fixes #212
#55 was merged while the code was still unfinished. As pointed out in the linked issue above, it current works for neither HTTP requests nor HTTPS requests.
This PR attempts to actually implement it.
(First two commits are from #303)
Add
Net::HTTP#proxy_use_ssl=to connect to the proxy server over TLS, andNet::HTTP#proxy_ssl_contextto configure the TLS settings.Also enable TLS automatically when the proxy setting taken from the environment variables has the https scheme.
Making HTTPS requests through an HTTPS proxy requires ruby/openssl 4.1, which supports nesting
OpenSSL::SSL::SSLSocketobjects.This PR depends on ruby/openssl#736, which should be merged soon.