From 869fbac632bc098f8d40fd7b43790fadce84ed1a Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 22 May 2019 14:14:26 -0600 Subject: Don't use auto HTTPS for servers with only HTTP port listeners --- modules/caddyhttp/caddyhttp.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/caddyhttp/caddyhttp.go') diff --git a/modules/caddyhttp/caddyhttp.go b/modules/caddyhttp/caddyhttp.go index 1ff2cbc..0fde218 100644 --- a/modules/caddyhttp/caddyhttp.go +++ b/modules/caddyhttp/caddyhttp.go @@ -188,6 +188,11 @@ func (app *App) automaticHTTPS() error { continue } + // skip if all listeners use the HTTP port + if !srv.listenersUseAnyPortOtherThan(app.HTTPPort) { + continue + } + // find all qualifying domain names, de-duplicated domainSet := make(map[string]struct{}) for _, route := range srv.Routes { -- cgit v1.2.3