Is it possible to enable http2 and have specific TLS configuration?

71 views
Skip to first unread message

Moshe Litvin

unread,
Oct 25, 2016, 12:46:31 PM10/25/16
to golang-nuts
The code in net/http/transport.go (onceSetNextProtoDefaults) contain:

 if t.TLSClientConfig != nil || t.Dial != nil || t.DialTLS != nil {
 
// Be conservative and don't automatically enable
 
// http2 if they've specified a custom TLS config or
 
// custom dialers. Let them opt-in themselves via
 
// http2.ConfigureTransport so we don't surprise them
 
// by modifying their tls.Config. Issue 14275.
 
return
 
}


Stating that if you did something non-standard in the dialer or TLS you don't get http2 by default.

But the suggested opt-in methods does not exist (was replace by the non-public http2ConfigureTransport.

The net/http documentation only specify opting out, but is there a way to opt-in?

Moshe

Dave Cheney

unread,
Oct 25, 2016, 12:48:30 PM10/25/16
to golang-nuts
Reply all
Reply to author
Forward
0 new messages