-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fabio does not serve http2 with go >= 1.7 #215
Comments
This patch re-enables the HTTP/2 support for go1.7 and beyond by setting the NextProto field in the custom TLSConfig. See golang/go#15908
@smancke like this? |
@magiconair yes |
I'm trying to see an HTTP/2 request in the
Any idea what I'm missing? |
the go http client does not do http2 by default, if you configure it with a custom tls config: in net/http/transport.go func (t *Transport) onceSetNextProtoDefaults() {
...
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
}
...
} There must be a way to force the transport by hand, but I don't found how .. |
@magiconair import "golang.org/x/net/http2"
clientTransport := &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: rootCAs,
},
}
http2.ConfigureTransport(clientTransport)
client := http.Client{
Transport: clientTransport,
} Proto: HTTP/2.0 |
This patch re-enables the HTTP/2 support for go1.7 and beyond by setting the NextProto field in the custom TLSConfig. See golang/go#15908
@smancke Awesome. Thanks a lot. I've updated the change to include the test. Testing for HTTP/2 feels grafted on though. Maybe its better to move this to a separate test but for now at least there is a test. |
Cool!! |
This patch re-enables the HTTP/2 support for go1.7 and beyond by setting the NextProto field in the custom TLSConfig. See golang/go#15908
This patch re-enables the HTTP/2 support for go1.7 and beyond by setting the NextProto field in the custom TLSConfig. See golang/go#15908
@smancke I can spin a 1.3.6 tomorrow. Also, time to wrap up the other lingering changes. Quick enough? |
Yes, would be very great! |
Thanks for finding and helping! Appreciated. |
This patch re-enables the HTTP/2 support for go1.7 and beyond by setting the NextProto field in the custom TLSConfig. See golang/go#15908
This patch re-enables the HTTP/2 support for go1.7 and beyond by setting the NextProto field in the custom TLSConfig. See golang/go#15908
Merged to master and published in 1.3.6 release. |
We found out, that fabio currently is not doing http2.
The reasons seems to be a change in go's behavior, when you supply a custom tls.Config (see golang/go#15908).
Before 1.7 it was fine to have
NextProtos: nil
, now it has to be set explicitly.NextProtos: []string{"h2"}
.The same thing hit the caddy server (see caddyserver/caddy#976).
When I add
in cert/source.go it has http support. This seems to be consistent to the documentation of the method
shouldConfigureHTTP2ForServe()
innet/http/server
.The text was updated successfully, but these errors were encountered: