Skip to content

Commit

Permalink
set the correct HTTP/3 ALPN for QUIC v2
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 26, 2022
1 parent b2deece commit 115fb28
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions http3/server.go
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 115fb28

Please sign in to comment.