diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-08-10 17:14:17 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-10 17:38:29 +0100 |
commit | 99a01f63f51b73f103cd1e094f1a8e7f35d9d30b (patch) | |
tree | 37cc9bdaf329773d284834b24d70ac1c14e6ffd3 /server | |
parent | 80bab78526a161b3389358a55652650bb35f567d (diff) |
Fix LetsEncrypt support
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/server.go b/server/server.go index 2995ead..42476f3 100644 --- a/server/server.go +++ b/server/server.go @@ -60,10 +60,12 @@ func Run(conf *config.Config) { if conf.Server.LetsEncryptServername != "" { m := autocert.Manager{ Prompt: autocert.AcceptTOS, - Cache: wkfscache.Cache(conf.Server.LetsEncryptCache), HostPolicy: autocert.HostWhitelist(conf.Server.LetsEncryptServername), } - tlsConfig.GetCertificate = m.GetCertificate + if conf.Server.LetsEncryptCache != "" { + m.Cache = wkfscache.Cache(conf.Server.LetsEncryptCache) + } + tlsConfig = m.TLSConfig() } else { if conf.Server.TLSCert == "" || conf.Server.TLSKey == "" { log.Fatal("TLS cert or key not specified in config") |