diff --git a/acme/http_challenge_server.go b/acme/http_challenge_server.go index 7597e437..33882236 100644 --- a/acme/http_challenge_server.go +++ b/acme/http_challenge_server.go @@ -58,6 +58,12 @@ func (s *httpChallengeServer) serve(domain, token, keyAuth string) { } }) - http.Serve(s.listener, mux) + httpServer := &http.Server{ + Handler: mux, + } + // Once httpServer is shut down we don't want any lingering + // connections, so disable KeepAlives. + httpServer.SetKeepAlivesEnabled(false) + httpServer.Serve(s.listener) s.done <- true }