Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Set tlsConfig.NextProtos to h2 in order to support HTTP/2
  • Loading branch information
Stanley Hu committed Jul 8, 2021
commit 7adc845caefc1d1210cdfe0f49208ba91368a224
1 change: 1 addition & 0 deletions cmd/web_letsencrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func runLetsEncrypt(listenAddr, domain, directory, email string, m http.Handler)
}

tlsConfig := magic.TLSConfig()
tlsConfig.NextProtos = append(tlsConfig.NextProtos, "h2")

if enableHTTPChallenge {
go func() {
Expand Down
2 changes: 1 addition & 1 deletion modules/graceful/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (srv *Server) ListenAndServe(serve ServeFunction) error {
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"}
}

config.Certificates = make([]tls.Certificate, 1)
Expand Down