Repository navigation
Don't leak target options into the proxy connection in forward-proxy mode - #494
Merged
Merged
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 |
whatyouhide
approved these changes
Jul 21, 2026
ericmj
pushed a commit
that referenced
this pull request
Sep 25, 2026
Since #494, the connection to the proxy in forward-proxy mode only gets the options in the :proxy tuple. That connection is the one returned to the caller, so a :mode given to Mint.HTTP.connect/4 was dropped and the connection started in active mode. Callers asking for a passive connection, such as Finch, then failed on the first recv/3. The proxy connection now defaults to the caller's :mode, and a :mode in the :proxy tuple still takes precedence.
ericmj
added a commit
to hexpm/hex
that referenced
this pull request
Oct 5, 2026
All four Mint changes Hex depended on are released upstream (elixir-mint/mint#478, #479, #480 and #481), so vendor from Mint main (fb850d3, v1.11.0) instead of the integration branch and drop the list of pending patches from scripts/vendor_mint.sh. Mint.Application no longer exists upstream, so the skip list for it is gone too. Mint v1.11.0 reads `:proxy_headers` from the top-level connect options and only uses the `:proxy` tuple's options for the connection to the proxy (elixir-mint/mint#494), so Hex.HTTP now passes the proxy-authorization header there.
ericmj
added a commit
to hexpm/hex
that referenced
this pull request
Oct 6, 2026
All four Mint changes Hex depended on are released upstream (elixir-mint/mint#478, #479, #480 and #481), so vendor from Mint main (fb850d3, v1.11.0) instead of the integration branch and drop the list of pending patches from scripts/vendor_mint.sh. Mint.Application no longer exists upstream, so the skip list for it is gone too. Mint v1.11.0 reads `:proxy_headers` from the top-level connect options and only uses the `:proxy` tuple's options for the connection to the proxy (elixir-mint/mint#494), so Hex.HTTP now passes the proxy-authorization header there.
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.