http-01 challenge: disable TCP connection reuse
If TCP connection reuse (KeepAlives) are left on then, in a sequence of challenges arising from a multiple-domain certficate, challenges after the 1st can fail due to reusing the now defunct tcp connection used in the first challenge. This has been observed when using the Go standard library reverse proxy to forward the challenges to Lego. Fixes #107
This commit is contained in:
parent
4efc9abf53
commit
9350fb4aef
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue