Merge pull request #108 from xi2/http01-disable-keepalives

http-01 challenge: disable TCP connection reuse
This commit is contained in:
xenolf 2016-02-08 02:15:30 +01:00
commit 614f5ea7ce

View file

@ -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
}