From a524bcfe78e8067b8224b1794c6842d9c2c7e8cf Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 26 Jun 2019 10:57:18 -0600 Subject: Enable skipping just certificate management for some auto HTTPS names --- modules/caddyhttp/server.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'modules/caddyhttp/server.go') diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index be46d6d..05763ba 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -133,12 +133,18 @@ type AutoHTTPSConfig struct { // in automatic HTTPS (they will not have certificates // loaded nor redirects applied). Skip []string `json:"skip,omitempty"` + + // Hosts/domain names listed here will still be enabled + // for automatic HTTPS (unless in the Skip list), except + // that certificates will not be provisioned and managed + // for these names. + SkipCerts []string `json:"skip_certificates,omitempty"` } -// HostSkipped returns true if name is supposed to be skipped -// when setting up automatic HTTPS. -func (ahc AutoHTTPSConfig) HostSkipped(name string) bool { - for _, n := range ahc.Skip { +// Skipped returns true if name is in skipSlice, which +// should be one of the Skip* fields on ahc. +func (ahc AutoHTTPSConfig) Skipped(name string, skipSlice []string) bool { + for _, n := range skipSlice { if name == n { return true } -- cgit v1.2.3