summaryrefslogtreecommitdiff
path: root/caddyconfig/httpcaddyfile
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-10-28 15:08:45 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-10-28 15:08:45 -0600
commit442fd748f6ef1215fb859d8aefe6c817988d189a (patch)
tree044a1ac9cfd9c701597f13de410c8d3a9a676454 /caddyconfig/httpcaddyfile
parentb00dfd3965f400956c5bb5b388e9d54ef98052e5 (diff)
caddyhttp: Minor cleanup and fix nil pointer deref in caddyfile adapter
Diffstat (limited to 'caddyconfig/httpcaddyfile')
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go6
1 files changed, 6 insertions, 0 deletions
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),