Merge pull request #408 from mrd0ll4r/fix-tls

http: fix TLS
This commit is contained in:
mrd0ll4r 2018-09-04 17:07:32 +02:00 committed by GitHub
commit 3bcb79129c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,8 +164,16 @@ func (f *Frontend) listenAndServe() error {
f.srv.SetKeepAlivesEnabled(false)
// Start the HTTP server.
if err := f.srv.ListenAndServe(); err != http.ErrServerClosed {
return err
if f.tlsCfg != nil {
// ... using TLS.
if err := f.srv.ListenAndServeTLS("", ""); err != http.ErrServerClosed {
return err
}
} else {
// ... using plain TCP.
if err := f.srv.ListenAndServe(); err != http.ErrServerClosed {
return err
}
}
return nil