1
0
Fork 0

Add support for Let's Encrypt http-01 challenge

This commit is contained in:
Frédéric Guillot 2018-02-04 18:05:45 -08:00
parent 3884a33b36
commit 12ff562d31
32 changed files with 2049 additions and 293 deletions

View file

@ -40,6 +40,13 @@ func newServer(cfg *config.Config, store *storage.Storage, pool *scheduler.Worke
HostPolicy: autocert.HostWhitelist(certDomain),
}
// Handle http-01 challenge.
s := &http.Server{
Handler: certManager.HTTPHandler(nil),
Addr: ":http",
}
go s.ListenAndServe()
go func() {
logger.Info(`Listening on "%s" by using auto-configured certificate for "%s"`, server.Addr, certDomain)
logger.Fatal(server.Serve(certManager.Listener()).Error())