1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

ensure that the TLS conifg contains the ALPN protocol (#1305)

This commit is contained in:
Andrew Braunstein 2019-03-12 17:54:16 -07:00 committed by Vishal Rana
parent 1f6cc362cc
commit e3717be4be

View File

@ -57,6 +57,7 @@ import (
"github.com/labstack/gommon/color"
"github.com/labstack/gommon/log"
"golang.org/x/crypto/acme"
"golang.org/x/crypto/acme/autocert"
)
@ -641,6 +642,7 @@ func (e *Echo) StartAutoTLS(address string) error {
s := e.TLSServer
s.TLSConfig = new(tls.Config)
s.TLSConfig.GetCertificate = e.AutoTLSManager.GetCertificate
s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, acme.ALPNProto)
return e.startTLS(address)
}