Repository navigation
Conversation
On Go 1.27, golang.org/x/net/http2 defaults to a wrapping implementation that hands HTTP/2 serving to net/http's internal server. net/http then serves h2 connections itself and never invokes the TLSNextProto handler gmux installs to sniff gRPC vs HTTP/2 traffic, which breaks gRPC routing and fails TestHTTP2OverTLSFramingConsistency. The http2legacy build tag selects x/net's original implementation, which registers TLSNextProto[h2] so net/http takes its legacy ALPN path and gmux keeps working as on Go 1.26. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
This pull request does not have a backport label. Could you fix it @aelnahas? 🙏
|
Contributor
|
This pull request is now in conflicts. Could you fix it @aelnahas? 🙏 |
💚 Build Succeeded
|
This branch has not been deployed
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/summary
Experiment branched off #21721 to check whether the
http2legacybuild tag unblocks the Go 1.27 upgrade.Go 1.27 moved the HTTP/2 implementation into
net/http. With x/net >= v0.55.0,http2.ConfigureServerregisters that internal implementation andnet/httpservesh2connections itself, never calling theTLSNextProtohandler gmux relies on to multiplex gRPC and HTTP/2. That is the cause of theTestHTTP2OverTLSFramingConsistencyfailure tracked in #21924.Building with
-tags http2legacyselects x/net's original implementation, which registersTLSNextProto["h2"], sonet/httptakes its retained legacy ALPN path and gmux works unchanged. This PR appends the tag toDEFAULT_TAGSin the Makefile, which flows into every build, test, and system-test target.This is a stopgap: x/net only backports critical and security fixes to the legacy implementation. The durable fix is in gmux.
How to test these changes
CI system tests, in particular
TestHTTP2OverTLSFramingConsistencyand the gRPC/OTLP system tests.Related issues
🤖 Generated with Claude Code