Modify the tlsConfig.NextProtos for Let's Encrypt and built-in HTTPS server in order to support HTTP/2.
Co-authored-by: 6543 <6543@obermui.de>
}
tlsConfig := magic.TLSConfig()
+ tlsConfig.NextProtos = append(tlsConfig.NextProtos, "h2")
if enableHTTPChallenge {
go func() {
func (srv *Server) ListenAndServeTLS(certFile, keyFile string, serve ServeFunction) error {
config := &tls.Config{}
if config.NextProtos == nil {
- config.NextProtos = []string{"http/1.1"}
+ config.NextProtos = []string{"h2", "http/1.1"}
}
config.Certificates = make([]tls.Certificate, 1)