From e873149bee9985621aa5539cda98761b12a758d8 Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Tue, 19 Feb 2019 19:08:34 +0300 Subject: [PATCH] Fix inability to start https server if it wasn't running --- control.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/control.go b/control.go index a8081e5b..8761dce3 100644 --- a/control.go +++ b/control.go @@ -1101,10 +1101,12 @@ func handleTLSConfigure(w http.ResponseWriter, r *http.Request) { marshalTLS(w, data) // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely - if restartHTTPS && httpsServer.server != nil { + if restartHTTPS { go func() { httpsServer.cond.Broadcast() - httpsServer.server.Shutdown(context.TODO()) + if httpsServer.server != nil { + httpsServer.server.Shutdown(context.TODO()) + } }() } }