diff options
Diffstat (limited to 'server/server.go')
-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") |