mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-22 10:12:11 +00:00
[bugfix] Fix server trying to listen twice on same address when l.e. enabled (#557)
This commit is contained in:
parent
8e30671a62
commit
898d256511
|
@ -91,10 +91,6 @@ func (r *router) Start() {
|
|||
http.Redirect(rw, r, target, http.StatusTemporaryRedirect)
|
||||
})
|
||||
|
||||
// Clone HTTP server but with autocert handler
|
||||
srv := r.srv
|
||||
srv.Handler = r.certManager.HTTPHandler(redirect)
|
||||
|
||||
// Start the LetsEncrypt autocert manager HTTP server.
|
||||
go func() {
|
||||
addr := fmt.Sprintf("%s:%d",
|
||||
|
@ -103,8 +99,7 @@ func (r *router) Start() {
|
|||
)
|
||||
|
||||
logrus.Infof("letsencrypt listening on %s", addr)
|
||||
|
||||
if err := srv.ListenAndServe(); err != nil &&
|
||||
if err := http.ListenAndServe(addr, r.certManager.HTTPHandler(redirect)); err != nil &&
|
||||
err != http.ErrServerClosed {
|
||||
logrus.Fatalf("letsencrypt: listen: %s", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue