Commit 741880a3 authored by Matthew Holt's avatar Matthew Holt

Only obtain certificate and enable TLS if host qualifies (fixes #638)

parent 43c339c7
...@@ -124,7 +124,7 @@ func ObtainCerts(configs []server.Config, allowPrompts, proxyACME bool) error { ...@@ -124,7 +124,7 @@ func ObtainCerts(configs []server.Config, allowPrompts, proxyACME bool) error {
var client *ACMEClient var client *ACMEClient
for _, cfg := range group { for _, cfg := range group {
if cfg.Host == "" || existingCertAndKey(cfg.Host) { if !HostQualifies(cfg.Host) || existingCertAndKey(cfg.Host) {
continue continue
} }
...@@ -190,7 +190,7 @@ func EnableTLS(configs []server.Config, loadCertificates bool) error { ...@@ -190,7 +190,7 @@ func EnableTLS(configs []server.Config, loadCertificates bool) error {
continue continue
} }
configs[i].TLS.Enabled = true configs[i].TLS.Enabled = true
if loadCertificates && configs[i].Host != "" { if loadCertificates && HostQualifies(configs[i].Host) {
_, err := cacheManagedCertificate(configs[i].Host, false) _, err := cacheManagedCertificate(configs[i].Host, false)
if err != nil { if err != nil {
return err return err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment