Enable HTTP/2 when loading TLS config from file (#423)

When creating TLSConfig from provided certificate file, the HTTP/2 support is not enabled.
It works with Certmanager because it adds h2 support.
We enable it the same way when creating TLSConfig from files.
This commit is contained in:
Misha Bragin 2022-08-15 19:36:00 +02:00 committed by GitHub
parent 245863cd51
commit 6dc3e8ca90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -319,6 +319,9 @@ func loadTLSConfig(certFile string, certKey string) (*tls.Config, error) {
config := &tls.Config{
Certificates: []tls.Certificate{serverCert},
ClientAuth: tls.NoClientCert,
NextProtos: []string{
"h2", "http/1.1", // enable HTTP/2
},
}
return config, nil