/tls/configure -- don't close https connection mid-request when configuration removes ports and certificates

This commit is contained in:
Eugene Bujak 2019-02-21 19:01:20 +03:00
parent 2814c393ad
commit 12f8590228
1 changed files with 1 additions and 0 deletions

View File

@ -1104,6 +1104,7 @@ func handleTLSConfigure(w http.ResponseWriter, r *http.Request) {
// until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
if restartHTTPS {
go func() {
time.Sleep(time.Second) // TODO: could not find a way to reliably know that data was fully sent to client by https server, so we wait a bit to let response through before closing the server
httpsServer.cond.Broadcast()
if httpsServer.server != nil {
httpsServer.server.Shutdown(context.TODO())