Scope TLS max_certs to site config instead of global

This commit is contained in:
Matthew Holt
2016-07-28 11:08:18 -06:00
parent 1e1e69b90f
commit af48bbd234
3 changed files with 25 additions and 22 deletions

View File

@ -156,9 +156,7 @@ func setupTLS(c *caddy.Controller) error {
if err != nil || maxCertsNum < 1 {
return c.Err("max_certs must be a positive integer")
}
if onDemandMaxIssue == 0 || int32(maxCertsNum) < onDemandMaxIssue { // keep the minimum; TODO: We have to do this because it is global; should be per-server or per-vhost...
onDemandMaxIssue = int32(maxCertsNum)
}
config.OnDemandState.MaxObtain = int32(maxCertsNum)
}
// don't try to load certificates unless we're supposed to