From 442fd748f6ef1215fb859d8aefe6c817988d189a Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 28 Oct 2019 15:08:45 -0600 Subject: caddyhttp: Minor cleanup and fix nil pointer deref in caddyfile adapter --- caddyconfig/httpcaddyfile/httptype.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'caddyconfig') diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index c8602f3..bc546b4 100644 --- a/caddyconfig/httpcaddyfile/httptype.go +++ b/caddyconfig/httpcaddyfile/httptype.go @@ -215,6 +215,12 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock, if tlsApp.Automation == nil { tlsApp.Automation = new(caddytls.AutomationConfig) } + if !hasACMECA { + acmeCA = "" + } + if !hasEmail { + email = "" + } tlsApp.Automation.Policies = append(tlsApp.Automation.Policies, caddytls.AutomationPolicy{ ManagementRaw: caddyconfig.JSONModuleObject(caddytls.ACMEManagerMaker{ CA: acmeCA.(string), -- cgit v1.2.3