correctly handle nil tls.Configs in the http09.RoundTripper

This commit is contained in:
Marten Seemann
2019-11-01 19:08:39 +07:00
parent 59cf1e88a7
commit e0c4c97a46

View File

@@ -41,7 +41,10 @@ func (r *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
}
c, ok := r.clients[hostname]
if !ok {
tlsConf := r.TLSClientConfig.Clone()
tlsConf := &tls.Config{}
if r.TLSClientConfig != nil {
tlsConf = r.TLSClientConfig.Clone()
}
tlsConf.NextProtos = []string{h09alpn}
c = &client{
hostname: hostname,