replace the list of ALPN instead of appending to it in http3

This commit is contained in:
Marten Seemann
2019-08-24 10:51:01 +07:00
parent f4621e280e
commit fd30146de5
4 changed files with 23 additions and 26 deletions

View File

@@ -57,10 +57,11 @@ func newClient(
) *client {
if tlsConf == nil {
tlsConf = &tls.Config{}
} else {
tlsConf = tlsConf.Clone()
}
if !strSliceContains(tlsConf.NextProtos, nextProtoH3) {
tlsConf.NextProtos = append(tlsConf.NextProtos, nextProtoH3)
}
// Replace existing ALPNs by H3
tlsConf.NextProtos = []string{nextProtoH3}
if quicConfig == nil {
quicConfig = defaultQuicConfig
}