1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-29 21:56:53 +02:00

Can be a fix for auto TLS

This commit is contained in:
Alexandre Stein 2018-03-01 15:08:09 +01:00 committed by Vishal Rana
parent 3641cbcdad
commit 7f6c0f4fc0

View File

@ -609,6 +609,10 @@ func (e *Echo) StartTLS(address string, certFile, keyFile string) (err error) {
// StartAutoTLS starts an HTTPS server using certificates automatically installed from https://letsencrypt.org.
func (e *Echo) StartAutoTLS(address string) error {
if e.Listener == nil {
go http.ListenAndServe(":http", e.AutoTLSManager.HTTPHandler(nil))
}
s := e.TLSServer
s.TLSConfig = new(tls.Config)
s.TLSConfig.GetCertificate = e.AutoTLSManager.GetCertificate