Repository navigation
Conversation
This was referenced Oct 30, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The pool can send requests through another user’s authenticated tunnel, and additional proxy handling and connection-management defects remain unresolved.
5 open issues
Include credentials in proxy pool identity to prevent cross-user reuse · New Sign proxy authentication for the CONNECT method and authority · New Preserve CONNECT refusal bodies or remove stale entity headers · New Share the per-destination connection limit across proxy pools · New Evict unused credential-specific proxy pools · New
What changed in this PR
This PR addresses HTTPS proxy authentication in the Netty client by moving proxy credentials onto CONNECT requests rather than sending them to the origin server.
Changes:
- Sends proxy authorization with CONNECT and exposes challenged tunnel refusals as 407 responses.
- Separates tunnel pools by proxy identity and delays TLS/HTTP setup until CONNECT succeeds.
- Adds authentication, credential-leak prevention, tunnel-reuse, and challenge tests, plus a changelog entry.
| File | Description |
|---|---|
org.restlet/src/test/java/org/restlet/engine/connector/ProxyTestCase.java |
Adds authenticated CONNECT tests and reusable HTTPS setup helpers. |
org.restlet/src/main/java/org/restlet/engine/netty/NettyClientHelper.java |
Updates tunnel authorization, pool selection, and protocol initialization. |
org.restlet/src/main/java/org/restlet/engine/netty/NettyClientCall.java |
Separates proxy credentials from origin headers and translates challenged refusals. |
changes.md |
Documents the HTTPS proxy authentication fix under 3.0 Milestone 2. |
Review effort: Balanced
The Netty client opened CONNECT tunnels without credentials, so an authenticating proxy refused them, and the Proxy-Authorization header of the request was sent to the origin server inside the tunnel. - NettyClientCall: move the Proxy-Authorization header of tunneled exchanges out of the request headers, and return a refusal of the proxy carrying a Proxy-Authenticate challenge as a 407 response, like for a forward proxy. - NettyClientHelper: send the header with the CONNECT request, keep tunnels apart per proxy credentials, and only add the TLS and HTTP handlers once the tunnel is established, so that the refusal of the proxy is reported as is rather than as a TLS handshake failure. - ProxyTestCase: authenticating test proxy, tunnel reuse, 407 challenge. Closes #1569. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jerome Louvel <374450+jlouvel@users.noreply.github.com>
Review follow-ups for the CONNECT credentials of HTTPS tunnels. - NettyClientCall: identify the tunnels of proxy credentials with a SHA-256 fingerprint of the scheme, raw value, identifier, secret and realm, so that different tokens or passwords never share a tunnel and the pool keys don't keep credentials in clear. Return only the Proxy-Authenticate challenges of a refused tunnel, not the entity headers of its discarded body. - NettyClientHelper: the pools of an origin share its connection permits, so maxConnectionsPerDestination still bounds the connections across proxy credentials, an idle tunnel of other credentials being closed when needed. The pools of proxy credentials are dropped once they have no connection left. - ProxyTestCase: tunnel per credentials, shared connection limit, no entity headers on a refused tunnel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jlouvel
force-pushed
the
fix/netty-proxy-connect-auth
branch
from
November 1, 2026 13:46
97714d6 to
c42cc64
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.





Closes #1569.
For HTTPS requests through an HTTP proxy, the Netty client opened the CONNECT tunnel without credentials, so an authenticating proxy refused it. The
Proxy-Authorizationheader built fromRequest.getProxyChallengeResponse()was then sent to the origin server inside the tunnel, which leaked the proxy credentials to the origin.The request's proxy credentials now go on the CONNECT request only, and a proxy refusal with a challenge comes back as a regular 407 response, as it already does for a forward proxy.
Changes
NettyClientCall: for tunneled exchanges, theProxy-Authorizationheader is moved out of the request headers and kept for the CONNECT request. AHttpProxyConnectExceptioncarrying aProxy-Authenticateheader becomes a407response with its proxy challenge requests. Other refusals are still connector errors.NettyClientHelper:ProxyTestCase: the test proxy can require credentials on CONNECT and records them. New tests cover credentials on the CONNECT request only (none reach the origin), reuse of the authenticated tunnel, and the 407 challenge. The HTTPS setup is factored into helpers.changes.md: entry under 3.0 Milestone 2, Bugs fixed.Validation
./mvnw -B -pl org.restlet -P default,test verify: 2,217 tests passed, 0 failures. JaCoCo checks are met. SpotBugs reports 8 findings, under the threshold of 9.Stack
This is the first of a stack of proxy fixes for the Netty client (#1569, #1570, #401, #1571, #1573, #1572). The next PRs are based on this branch.
🤖 Generated with Claude Code