Skip to content

Commit

Permalink
Disable HTTP/2 by default
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Goncalves <[email protected]>
  • Loading branch information
cgoncalves committed Oct 20, 2023
1 parent 405192d commit 4371417
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func main() {
insecure := flag.Bool("insecure", false, "Disable adding client CA to server TLS endpoint --insecure")
flag.Var(&clientCAPaths, "client-ca", "File containing client CA. This flag is repeatable if more than one client CA needs to be added to server")
healthCheckPort := flag.Int("health-check-port", 8444, "The port to use for health check monitoring")
enableHTTP2 := flag.Bool("enable-http2", false, "If HTTP/2 should be enabled for the webhook server.")

// do initialization of control switches flags
controlSwitches := controlswitches.SetupControlSwitchesFlags()
Expand Down Expand Up @@ -170,6 +171,11 @@ func main() {
},
}

// CVE-2023-39325 https://github.com/golang/go/issues/63417
if !*enableHTTP2 {
httpServer.TLSConfig.NextProtos = []string{"http/1.1"}
}

err := httpServer.ListenAndServeTLS("", "")
if err != nil {
glog.Fatalf("error starting web server: %v", err)
Expand Down

0 comments on commit 4371417

Please sign in to comment.