Repository navigation
fix: verify HTTPS proxy certificates before CONNECT - #368
Open
abu-tahir-0 wants to merge 1 commit into
Open
abu-tahir-0 wants to merge 1 commit into
abu-tahir-0 wants to merge 1 commit into
Conversation
Use a dedicated proxy SSL context with peer and hostname verification so proxy credentials and application bytes are never sent over an unauthenticated TLS connection. Add an optional proxy certificate store and cover trusted, untrusted, and wrong-host proxies.
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.
Problem
Net::HTTP::Proxy(..., true)wrapped the proxy connection in TLS without enabling certificate or hostname verification. Proxy credentials and application traffic could therefore be sent to an unauthenticated proxy.Root cause
The proxy TLS socket was created with a default
SSLContext, whose verification mode isVERIFY_NONE. Origin-server verification settings were not applied to the proxy connection.Solution
Create a separate proxy
SSLContextwithVERIFY_PEERand hostname checking, set SNI for DNS proxy addresses, support an optionalproxy_cert_store, and callpost_connection_checkbefore CONNECT or proxy authentication. Origin-server TLS configuration remains independent.Testing
rbs validate, and diff check passed.Fixes #308