From 115fb2826d108755137ff11b2439ffbb9d47d8bc Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 23 May 2022 19:38:02 +0200 Subject: [PATCH] set the correct HTTP/3 ALPN for QUIC v2 --- http3/server.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/http3/server.go b/http3/server.go index 645b2b3ea27..8d50f5b12a7 100644 --- a/http3/server.go +++ b/http3/server.go @@ -44,7 +44,7 @@ const ( ) func versionToALPN(v protocol.VersionNumber) string { - if v == protocol.Version1 { + if v == protocol.Version1 || v == protocol.Version2 { return nextProtoH3 } if v == protocol.VersionTLS || v == protocol.VersionDraft29 { @@ -63,11 +63,9 @@ func ConfigureTLSConfig(tlsConf *tls.Config) *tls.Config { return &tls.Config{ GetConfigForClient: func(ch *tls.ClientHelloInfo) (*tls.Config, error) { // determine the ALPN from the QUIC version used - proto := nextProtoH3Draft29 + proto := nextProtoH3 if qconn, ok := ch.Conn.(handshake.ConnWithVersion); ok { - if qconn.GetQUICVersion() == protocol.Version1 { - proto = nextProtoH3 - } + proto = versionToALPN(qconn.GetQUICVersion()) } config := tlsConf if tlsConf.GetConfigForClient != nil {