Skip to content

HTTPCLIENT-2261 - Enable HTTP/2 CONNECT tunneling for HTTP/2 clients … - #810

Open
arturobernalg wants to merge 15 commits into
apache:masterfrom
arturobernalg:HTTPCLIENT-2261
Open

arturobernalg wants to merge 15 commits into
apache:masterfrom
arturobernalg:HTTPCLIENT-2261

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

…through HTTP/2 proxies

Wire HTTP/2 tunnel establishment into InternalH2ConnPool for tunneled routes by using H2OverH2TunnelSupport to convert an existing proxy HTTP/2 connection into a stream-backed tunnel session

@arturobernalg

Copy link
Copy Markdown
Member Author

We need this first apache/httpcomponents-core#648

@arturobernalg
arturobernalg force-pushed the HTTPCLIENT-2261 branch 3 times, most recently from 2777d03 to 58c724d Compare March 24, 2026 09:16
@arturobernalg
arturobernalg force-pushed the HTTPCLIENT-2261 branch 4 times, most recently from f0f0a43 to 69cb83b Compare April 10, 2026 17:30
@arturobernalg
arturobernalg marked this pull request as ready for review April 10, 2026 17:30
@ok2c

ok2c commented Apr 26, 2026

Copy link
Copy Markdown
Member

@arturobernalg This is a log of code. We need a compatibility test case similar to ApacheHTTPDSquidCompatibilityIT to be sure it actually works correctly. I am not entirely sure this is all worth the efforts.

@arturobernalg
arturobernalg force-pushed the HTTPCLIENT-2261 branch 3 times, most recently from 6fd3ba4 to d755511 Compare April 29, 2026 13:11
@arturobernalg

Copy link
Copy Markdown
Member Author

@arturobernalg This is a log of code. We need a compatibility test case similar to ApacheHTTPDSquidCompatibilityIT to be sure it actually works correctly. I am not entirely sure this is all worth the efforts.

@ok2c add it. please do another passs

No notifications block meant issue events defaulted to [email protected]
via the Apache Git Service. Harmless at normal volume, but the Jira
Issues migration (INFRA-28579) is about to import 2347 issues here,
which would flood the list. Point issues at [email protected]
instead, same pattern apache/maven and apache/opennlp use after their
own Jira migrations.
The ASF Git Service's .asf.yaml validator rejected [email protected]:
notifications targets must be the project's real @httpcomponents.apache.org
list, not the hc.apache.org vanity domain used on the website/mail links.
Neither [email protected] nor [email protected]
validated. Infra is creating [email protected] instead
(INFRA-28579, simpler than a new list under httpcomponents.apache.org).
Don't merge until confirmed created.
The mapping was fixed in apache/infrastructure-asfyaml#152 (httpcomponents
-> hc), but issue notifications still went to dev@ after the merge. No
content change, just a fresh push to .asf.yaml to force the Git Service
to re-evaluate the notifications block.
Per Infra (Bob), force a real value-diff push to .asf.yaml so the Git
Service fully reprocesses notifications::issues end to end, rather
than a no-op comment-only re-save. Restored to [email protected]
in a follow-up commit.
Second half of the revert/restore cycle Infra (Bob) asked for, to force
the Git Service to fully reprocess notifications::issues end to end.
Define INTERLEAVE as no-bias and align tests and debug output.
Add manual gated IT to dump DEFAULT vs INTERLEAVE results.
Expand unit coverage for scope mapping and core RFC comparison rules.
…ults.

Tighten resolver semantics and filtering for HTTP/TCP connect targets.
arturobernalg and others added 6 commits November 26, 2026 15:08
Races connection attempts across a host's resolved addresses instead
of trying them strictly sequentially: first address immediately, each
next one after a configurable delay (250ms default) unless an earlier
one fails first, in which case the next address starts at the RFC
8305 Section 5 minimum spacing (10ms). First success wins; the rest
are cancelled or closed. An attempt cancelled from outside the race is
treated like a failure so the future is never left pending forever.

A winning session can be selected by the race at the same moment the
caller cancels the outer Future directly. ComplexFuture#completed then
returns false; close the session instead of silently dropping it.

Opt-in, off by default; disabled behavior is unchanged.
…ient

Replaces the one-thread-per-address, sleep-based stagger with a single
dispatcher that starts the first address immediately and waits up to
the connection attempt delay for an outstanding attempt to finish
before starting the next; on a failure it advances immediately, at the
RFC 8305 minimum spacing (10ms), instead of waiting out the full delay.
No worker thread ever sleeps a delay itself, bounding concurrency to
the number of resolved addresses actually in flight.

Socket registration goes through a small atomic registry instead of a
bare reference: deciding a winner and a worker registering its socket
can happen at the same instant, and whichever runs second closes the
socket, so nothing registered around that moment survives open
regardless of timing. shutdownNow() alone cannot abort a blocking
Socket#connect; closing the socket is what actually does that, on
every exit path (winner found, every address failed, or interrupted)
via one cleanup call in a finally block.

An interruption during the minimum-spacing wait is now propagated
instead of swallowed, aborting the race immediately like interruption
anywhere else in it. Racing is skipped in favor of the existing
sequential path when a specific, non-ephemeral local port is
requested, since binding several attempts to it concurrently would
trade a real connect failure for a spurious bind conflict.

Public, blocking connect() behavior, TLS, SOCKS and local binding are
otherwise unchanged.
Since the challenge parsing was reworked, a single malformed
WWW-Authenticate or Proxy-Authenticate header causes all challenges in
the response to be discarded, so a valid Basic or Digest challenge in
another header is no longer used and the 401 is returned as is. Before
that change only the malformed header was skipped.

The empty map returned in that case is also immutable, so a response
that carries Authentication-Info together with a malformed challenge
header fails with UnsupportedOperationException.

Parse each header separately again and skip only the ones that fail.
Bumps the all group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [org.conscrypt:conscrypt-openjdk-uber](https://github.com/google/conscrypt) | `2.8.0` | `2.10.0` |
| [org.junit:junit-bom](https://github.com/junit-team/junit-framework) | `5.14.4` | `5.14.5` |
| [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) | `1.5.7-25` | `1.6.0-1` |
| [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) | `1.17.2` | `1.18.0` |
| [io.micrometer:micrometer-observation](https://github.com/micrometer-metrics/micrometer) | `1.17.2` | `1.18.0` |
| [io.micrometer:micrometer-registry-prometheus](https://github.com/micrometer-metrics/micrometer) | `1.17.2` | `1.18.0` |
| [io.micrometer:micrometer-tracing](https://github.com/micrometer-metrics/tracing) | `1.7.2` | `1.8.0` |
| [io.micrometer:micrometer-tracing-bridge-otel](https://github.com/micrometer-metrics/tracing) | `1.7.2` | `1.8.0` |
| [io.opentelemetry:opentelemetry-bom](https://github.com/open-telemetry/opentelemetry-java) | `1.67.0` | `1.68.0` |
| org.apache.maven:apache-maven | `3.10.0` | `3.10.2` |


Updates `org.conscrypt:conscrypt-openjdk-uber` from 2.8.0 to 2.10.0
- [Release notes](https://github.com/google/conscrypt/releases)
- [Commits](google/conscrypt@2.8.0...2.10.0)

Updates `org.junit:junit-bom` from 5.14.4 to 5.14.5
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](junit-team/junit-framework@r5.14.4...r5.14.5)

Updates `com.github.luben:zstd-jni` from 1.5.7-25 to 1.6.0-1
- [Commits](luben/zstd-jni@v1.5.7-25...v1.6.0-1)

Updates `io.micrometer:micrometer-core` from 1.17.2 to 1.18.0
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](micrometer-metrics/micrometer@v1.17.2...v1.18.0)

Updates `io.micrometer:micrometer-observation` from 1.17.2 to 1.18.0
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](micrometer-metrics/micrometer@v1.17.2...v1.18.0)

Updates `io.micrometer:micrometer-registry-prometheus` from 1.17.2 to 1.18.0
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](micrometer-metrics/micrometer@v1.17.2...v1.18.0)

Updates `io.micrometer:micrometer-observation` from 1.17.2 to 1.18.0
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](micrometer-metrics/micrometer@v1.17.2...v1.18.0)

Updates `io.micrometer:micrometer-registry-prometheus` from 1.17.2 to 1.18.0
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](micrometer-metrics/micrometer@v1.17.2...v1.18.0)

Updates `io.micrometer:micrometer-tracing` from 1.7.2 to 1.8.0
- [Release notes](https://github.com/micrometer-metrics/tracing/releases)
- [Commits](micrometer-metrics/tracing@v1.7.2...v1.8.0)

Updates `io.micrometer:micrometer-tracing-bridge-otel` from 1.7.2 to 1.8.0
- [Release notes](https://github.com/micrometer-metrics/tracing/releases)
- [Commits](micrometer-metrics/tracing@v1.7.2...v1.8.0)

Updates `io.micrometer:micrometer-tracing-bridge-otel` from 1.7.2 to 1.8.0
- [Release notes](https://github.com/micrometer-metrics/tracing/releases)
- [Commits](micrometer-metrics/tracing@v1.7.2...v1.8.0)

Updates `io.opentelemetry:opentelemetry-bom` from 1.67.0 to 1.68.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-java@v1.67.0...v1.68.0)

Updates `org.apache.maven:apache-maven` from 3.10.0 to 3.10.2

---
updated-dependencies:
- dependency-name: org.conscrypt:conscrypt-openjdk-uber
  dependency-version: 2.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: org.junit:junit-bom
  dependency-version: 5.14.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: com.github.luben:zstd-jni
  dependency-version: 1.6.0-1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.micrometer:micrometer-core
  dependency-version: 1.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.micrometer:micrometer-observation
  dependency-version: 1.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.micrometer:micrometer-registry-prometheus
  dependency-version: 1.18.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.micrometer:micrometer-observation
  dependency-version: 1.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.micrometer:micrometer-registry-prometheus
  dependency-version: 1.18.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.micrometer:micrometer-tracing
  dependency-version: 1.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.micrometer:micrometer-tracing-bridge-otel
  dependency-version: 1.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.micrometer:micrometer-tracing-bridge-otel
  dependency-version: 1.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: io.opentelemetry:opentelemetry-bom
  dependency-version: 1.68.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: org.apache.maven:apache-maven
  dependency-version: 3.10.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.6.0 to 6.3.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v5.6.0...v6.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
…through HTTP/2 proxies

Wire HTTP/2 tunnel establishment into InternalH2ConnPool for tunneled routes by using H2OverH2TunnelSupport to convert an existing proxy HTTP/2 connection into a stream-backed tunnel session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants