Skip to content

Commit

Permalink
Merge pull request #32231 from timothysc/re-re-http2
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Default HTTP2 on, post fixes from #29001

This reverts commit 8cb799c.

Enables HTTP2 on by default post fixes from #29001 for 1.5 

NOTE:  We are nearing lb connection limits at current thresholds. 

/cc @bradfitz @lavalamp @smarterclayton
  • Loading branch information
Kubernetes Submit Queue committed Sep 26, 2016
2 parents 2a59f57 + 009f877 commit 3efed28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/genericapiserver/genericapiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ func (s *GenericAPIServer) Run(options *options.ServerRunOptions) {
secureServer.TLSConfig.ClientAuth = tls.RequestClientCert
// Specify allowed CAs for client certificates
secureServer.TLSConfig.ClientCAs = clientCAs
// "h2" NextProtos is necessary for enabling HTTP2 for go's 1.7 HTTP Server
secureServer.TLSConfig.NextProtos = []string{"h2"}

}

glog.Infof("Serving securely on %s", secureLocation)
Expand Down
6 changes: 4 additions & 2 deletions pkg/util/net/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ func SetOldTransportDefaults(t *http.Transport) *http.Transport {
// for the Proxy, Dial, and TLSHandshakeTimeout fields if unset
func SetTransportDefaults(t *http.Transport) *http.Transport {
t = SetOldTransportDefaults(t)
// Allow HTTP2 clients but default off for now
if s := os.Getenv("ENABLE_HTTP2"); len(s) > 0 {
// Allow clients to disable http2 if needed.
if s := os.Getenv("DISABLE_HTTP2"); len(s) > 0 {
glog.Infof("HTTP2 has been explicitly disabled")
} else {
if err := http2.ConfigureTransport(t); err != nil {
glog.Warningf("Transport failed http2 configuration: %v", err)
}
Expand Down

0 comments on commit 3efed28

Please sign in to comment.