Repository navigation
core: Do not offer 'h2' via Upgrade on TLS connections. - #836
Open
arturobernalg wants to merge 2 commits into
Open
arturobernalg wants to merge 2 commits into
arturobernalg wants to merge 2 commits into
Conversation
* 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 exclusively via ALPN; offering 'h2' through the HTTP/1.1 Upgrade mechanism on TLS is a protocol violation that some clients handle poorly. * test/modules/http2/test_103_upgrade.py (test_h2_103_06): Update to assert the corrected behaviour. * changes-entries/h2-upgrade-tls.txt: Add entry. This restores the fix from r1740075 (2016), reverted in r1748591 only for lack of a 2.4.x backport, not for being incorrect. PR: 59311
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.
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-entries 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.
PR: 59311