fix: gracefully handling https.server starting errors

This commit is contained in:
evilsocket 2019-03-19 01:13:30 +01:00
parent 51667a039f
commit c830e64309
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -159,7 +159,8 @@ func (mod *HttpsServer) Start() error {
return mod.SetRunning(true, func() {
mod.Info("starting on https://%s", mod.server.Addr)
if err := mod.server.ListenAndServeTLS(mod.certFile, mod.keyFile); err != nil && err != http.ErrServerClosed {
panic(err)
mod.Error("%v", err)
mod.Stop()
}
})
}