Skip to content

[2.4.x] core: Do not offer 'h2' via Upgrade on TLS connections. - #837

Open
arturobernalg wants to merge 1 commit into
apache:2.4.xfrom
arturobernalg:backport/httpd-59311-h2-upgrade-tls
Open

arturobernalg wants to merge 1 commit into
apache:2.4.xfrom
arturobernalg:backport/httpd-59311-h2-upgrade-tls

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Backport of trunk PR #836 (fix/httpd-59311-h2-upgrade-tls).

RFC 9113 section 3.3 requires HTTP/2 over TLS to be negotiated exclusively via ALPN. httpd currently announces "Upgrade: h2" to HTTP/1.1 clients on TLS connections, which violates that.

server/protocol.c (ap_get_protocol_upgrades): exclude 'h2' from the Upgrade header when the connection is TLS. Test updated (test_103_upgrade.py, test_h2_103_06) and CHANGES entry added.

This restores the fix from r1740075 (2016), reverted in r1748591 only for lack of a 2.4.x backport, not for being incorrect.

Tested locally: make check-pytest PYTEST_DIRS=test/modules/http2 passes for the affected test.

As usual for 2.4.x, this needs a STATUS file proposal and votes before merge.

PR: 59311

@arturobernalg
arturobernalg force-pushed the backport/httpd-59311-h2-upgrade-tls branch from 945c587 to 71d2a83 Compare November 6, 2026 22:06
@covener covener changed the title core: Do not offer 'h2' via Upgrade on TLS connections. [2.4.x] core: Do not offer 'h2' via Upgrade on TLS connections. Nov 16, 2026
@covener

covener commented Nov 16, 2026

Copy link
Copy Markdown
Member

@arturobernalg conflicts developed

* server/protocol.c (ap_get_protocol_upgrades): Exclude 'h2' from the
  list of protocols announced in the Upgrade response header when the
  connection is already using TLS.  RFC 9113 section 3.3 requires
  HTTP/2 over TLS to be negotiated with ALPN.

* test/modules/http2/test_103_upgrade.py (test_h2_103_06): Update to
  assert the corrected behaviour.

* changes-entries/h2-upgrade-tls.txt: New entry.

Same change as trunk PR apache#836.

PR: 59311
@arturobernalg
arturobernalg force-pushed the backport/httpd-59311-h2-upgrade-tls branch from 71d2a83 to 8b885e3 Compare November 28, 2026 19:29
@arturobernalg

Copy link
Copy Markdown
Member Author

@arturobernalg conflicts developed

Solved @covener

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.

2 participants