mirror of
https://github.com/caddyserver/caddy.git
synced 2025-11-01 22:32:23 +08:00
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
@ -265,6 +265,22 @@ func (app *App) automaticHTTPSPhase1(ctx caddy.Context, repl *caddy.Replacer) er
|
||||
}
|
||||
}
|
||||
|
||||
// if all servers have auto_https disabled and no domains need certs,
|
||||
// skip the rest of the TLS automation setup to avoid creating
|
||||
// unnecessary PKI infrastructure and automation policies
|
||||
allServersDisabled := true
|
||||
for _, srv := range app.Servers {
|
||||
if srv.AutoHTTPS == nil || !srv.AutoHTTPS.Disabled {
|
||||
allServersDisabled = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if allServersDisabled && len(uniqueDomainsForCerts) == 0 {
|
||||
logger.Debug("all servers have automatic HTTPS disabled and no domains need certificates, skipping TLS automation setup")
|
||||
return nil
|
||||
}
|
||||
|
||||
// we now have a list of all the unique names for which we need certs
|
||||
var internal, tailscale []string
|
||||
uniqueDomainsLoop:
|
||||
|
||||
Reference in New Issue
Block a user