Add https proxy support - #6215
Open
gaganis wants to merge 9 commits into
Open
Conversation
gaganis
force-pushed
the
https-proxy-support
branch
2 times, most recently
from
June 26, 2026 08:20
01a7c60 to
93b7ef3
Compare
gaganis
force-pushed
the
https-proxy-support
branch
from
June 26, 2026 11:50
93b7ef3 to
d0021d1
Compare
gaganis
marked this pull request as ready for review
June 26, 2026 11:51
vietj
force-pushed
the
https-proxy-support
branch
from
June 28, 2026 21:24
d0021d1 to
0b5db35
Compare
vietj
self-requested a review
June 29, 2026 12:19
vietj
reviewed
Jun 30, 2026
vietj
reviewed
Jun 30, 2026
vietj
reviewed
Jun 30, 2026
vietj
reviewed
Jun 30, 2026
vietj
reviewed
Jun 30, 2026
vietj
reviewed
Jun 30, 2026
vietj
requested changes
Jun 30, 2026
gaganis
force-pushed
the
https-proxy-support
branch
from
July 1, 2026 09:16
e0ad60d to
8ae9b16
Compare
vietj
reviewed
Jul 15, 2026
vietj
reviewed
Jul 15, 2026
vietj
reviewed
Jul 15, 2026
vietj
reviewed
Jul 15, 2026
vietj
requested changes
Jul 15, 2026
vietj
left a comment
Member
There was a problem hiding this comment.
A few comments have been made to this PR.
Member
|
@gaganis ping, can you also look at the conflict to resolve ? |
gaganis
force-pushed
the
https-proxy-support
branch
3 times, most recently
from
July 25, 2026 08:16
6be4212 to
cf6c7cd
Compare
vietj
reviewed
Jul 27, 2026
| * <p>Covers the four main proxy-capable connection types (NetSocket, HTTP/1, HTTP/2, WebSocket) | ||
| * against a plain and a TLS origin. | ||
| */ | ||
| public class ProxyIsSslConsistencyTest extends HttpTestBase { |
Member
There was a problem hiding this comment.
this test need to extend HttpTestBase2 instead as we are trying to get away from HttpTestBase.
In addition we should be using the new config classes over the options classes whenever possible.
vietj
reviewed
Jul 27, 2026
| * TLS. The proxying semantics (absolute-URI {@code GET} forwarding for plain origins, {@code CONNECT} | ||
| * tunnel for TLS origins) are unchanged from {@link ProxyType#HTTP}. | ||
| */ | ||
| public class HttpsProxyTest extends HttpTestBase { |
Co-authored-by: Julien Viet <julien@julienviet.com>
We want isSsl to return consistent results regardless of whether we connect via a http or https proxy. A proxy is a connection detail that should not affect how origin connections are viewed
vietj
force-pushed
the
https-proxy-support
branch
from
July 28, 2026 09:40
cf6c7cd to
e1d09d0
Compare
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.
Motivation:
Closes: #6207
Add HTTPS proxy support (
ProxyType.HTTPS)What this adds
Support for connecting to a forward proxy over TLS — i.e. the connection to
the proxy itself (leg 1) is encrypted. Enabled via:
The proxying semantics are unchanged from
ProxyType.HTTP:GET, single TLS leg to theproxy).
CONNECTtunnel (leg-1 TLS to the proxy, then a secondnested TLS to the origin). HTTP/2 over the tunnel negotiates via ALPN
end-to-end. Works for both
HttpClientandNetClient(upgradeToSsl).Key design decisions
ConnectionBase.isSsl()keeps meaning "the origin is TLS", not "the wireis TLS". Existing code and the public contract rely on
ConnectionBase.isSsl()reflecting the origin. Rather than overload it,transport-level TLS (TLS to an HTTPS proxy) is computed separately via the
transportSsl/proxyHttpshelpers inTcpHttpClientTransport. The newoverride
Http1ClientConnection.isSsl()returns the origin flag.Transport-level "how to connect" calculations live in the transport.
HttpConnectParamscarries intent (forwardProxyflag, originssl,original
proxyOptions);TcpHttpClientTransportderives peer/SNI, TLSoptions, ALPN eligibility, and proxy hostname verification at the point of
use. The forward-vs-CONNECT decision stays at endpoint-creation time because
it selects the pooling/connect target (
EndpointKey).Zero-copy file region is gated on the actual pipeline, not
ConnectionBase.isSsl(). BecauseConnectionBase.isSsl()now strictlymeans "origin",
VertxConnection.supportsFileRegion()checks for anSslHandlerin the pipeline instead of calling the inheritedConnectionBase.isSsl()— zero-copy must be disabled whenever the wire isencrypted (e.g. leg-1 TLS to the proxy), regardless of the logical origin
flag.
Two
SslHandlers in the CONNECT-tunnel pipeline.NetSocketImplinsertsthe origin (leg-2) handler after the proxy (leg-1) handler (
proxy-ssl→ssl), andapplicationLayerProtocol()reads the innermostSslHandler, since ALPN is negotiated on the origin handshake.Secure defaults for the proxy leg. Hostname verification defaults to
"HTTPS"for the proxy connection; ALPN is never offered on the leg-1(proxy) handshake — it belongs to the origin; there is no plaintext
fallback for an HTTPS proxy (a TLS handshake failure against a plaintext
proxy fails cleanly rather than downgrading). Mutual TLS to the proxy is
supported.
Proxy SSL options participate in pool identity.
EndpointKeyincludesProxyOptions.getSslOptions()inequals/hashCodeso connections withdifferent proxy TLS config aren't pooled together.
Tests
HttpsProxyTest: forward (plain origin),CONNECTtunnel (HTTP/1 andHTTP/2 origins), proxy auth, mutual TLS, and negative cases (untrusted proxy
cert, hostname mismatch, plaintext-proxy no-downgrade).
NetTestcases forCONNECTover a TLS proxy (NetClient+upgradeToSsl).ProxyOptionsTestfor the newsslOptionsfield.Issues encountered & how they were resolved
(
testHttpsProxy_Http2Origin_tunnelled): the response body was read acrossthe
await()boundary, so body chunks could arrive with no handler attached.Fixed by reading the body inside the same future composition
(
resp.body().map(...)), which also folds the negotiated version into theasserted value. (Commit
2b8895f51.)HttpsProxyTest: fixed (commit93b7ef36b).Note on CI failures
CI runs on this branch intermittently failed on tests that I have seen failing
also in unrelated PRs suggesting these are flaky tests.
HttpSendFileTest.testSendOpenRangeFileFromClasspath(empty HTTP body), andNetTest.testListenDomainSocketAddress(empty receive,-PNativeEpoll).Conformance:
You should have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md
Please also make sure you adhere to the code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines