Don't leak target options into the proxy connection in forward-proxy mode#494
Open
ericmj wants to merge 1 commit into
Open
Don't leak target options into the proxy connection in forward-proxy mode#494ericmj wants to merge 1 commit into
ericmj wants to merge 1 commit into
Conversation
…mode Mint.HTTP.connect/4 merged the target connect options with the proxy options and handed the whole set to the connection to the proxy. A target :hostname was therefore used as the proxy connection's hostname, so with an :https proxy the proxy's certificate was verified against the target's identity, and :transport_opts meant for the target applied to the proxy socket. Forward-proxy mode now keeps the two option sets separate, like tunnel mode already does: the proxy connection is configured by the options in the :proxy tuple, while the options given to Mint.HTTP.connect/4 describe the target (its :hostname identity and the :proxy_headers).
Coverage Report for CI Build 0Coverage increased (+0.05%) to 87.599%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
Mint.HTTP.connect/4merged the target connect options with the proxy options and handed the whole set to the connection to the proxy. A target:hostnamewas therefore used as the proxy connection's hostname — so with an:httpsproxy, the proxy's certificate got verified against the target's identity — and:transport_optsmeant for the target applied to the proxy socket.Forward-proxy mode now keeps the two option sets separate, like tunnel mode already does: the proxy connection is configured by the options in the
:proxytuple, while the options given toMint.HTTP.connect/4describe the target (its:hostnameidentity and the:proxy_headers).The new offline tests connect through a local TLS server acting as an
:httpsforward proxy; the two tests that pin the option separation fail against the previous behavior.