Open abishekmuthian opened 5 years ago
How did you get it to work on port 443?
@pjebs Please refer to this - https://github.com/fragmenta/server/issues/8.
I used go http.ListenAndServe(":http", certManager.HTTPHandler(nil))
with production port 433
, But as Kenny suggests use StartTLSAuto
.
By default production port is set to 80, it needs to be 443 as there's redirection from 80 to 443.
But in order for autocert's LetsEncrypt first verification to work, the redirection has to be handled by certManager's handler in the fragmenta server(https://github.com/fragmenta/server/issues/8).
When that's done, calling StartRedirectAll is unnecessary as the above will do the same.
Perhaps, since gohackernews was using certificates in key to start with; it worked without the need for initial LetsEncrypt callback after autocert implementation thereby not facing this issue.