mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-25 10:46:01 +03: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
1 changed files with 1 additions and 6 deletions
|
@ -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