From a0b89329c9b43656997fae7fe134514aaf9bad4c Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Sat, 9 May 2026 11:12:56 +0800 Subject: [PATCH] net/http: fix Server's UnencryptedHTTP2 does not work TLS without ALPN --- src/net/http/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/http/server.go b/src/net/http/server.go index 933dcc95f2..889adef230 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -2026,7 +2026,7 @@ func (c *conn) serve(ctx context.Context) { c.bufw = newBufioWriterSize(checkConnErrorWriter{c}, 4<<10) protos := c.server.protocols() - if c.tlsState == nil && protos.UnencryptedHTTP2() { + if protos.UnencryptedHTTP2() { if c.maybeServeUnencryptedHTTP2(ctx) { return }