mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-23 17:16:40 +01:00
Only obtain certificate and enable TLS if host qualifies (fixes #638)
This commit is contained in:
parent
43c339c7e3
commit
741880a38b
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue