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

OCPBUGS-21192: disable HTTP2 by default #849

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 10 additions & 3 deletions cmd/webhook/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import (
)

var (
certFile string
keyFile string
port int
certFile string
keyFile string
port int
enableHTTP2 bool
)

var (
Expand Down Expand Up @@ -48,6 +49,7 @@ func init() {
"File containing the default x509 private key matching --tls-cert-file.")
startCmd.Flags().IntVar(&port, "port", 443,
"Secure port that the webhook listens on")
startCmd.Flags().BoolVar(&enableHTTP2, "enable-http2", false, "If HTTP/2 should be enabled for the metrics and webhook servers.")
}

// serve handles the http portion of a request prior to handing to an admit
Expand Down Expand Up @@ -152,6 +154,11 @@ func runStartCmd(cmd *cobra.Command, args []string) {
TLSConfig: &tls.Config{
GetCertificate: keyPair.GetCertificateFunc(),
},
// CVE-2023-39325 https://github.com/golang/go/issues/63417
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)),
}
if enableHTTP2 {
server.TLSNextProto = nil
}
err := server.ListenAndServeTLS("", "")
if err != nil {
Expand Down