Skip to content
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

Disable HTTP/2 by default #143

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading