summaryrefslogtreecommitdiff
path: root/caddyconfig
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-09-30 11:53:21 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-09-30 11:53:21 -0600
commitc95db3551d79112513196b71841de8d010a42b25 (patch)
treec6d38dff279adac9189714347d120edac512da51 /caddyconfig
parent8eb2c3725199b17ae713dd0756a0e491e4829c12 (diff)
caddytls: Ensure automation field is not nil when appending (fix #2779)
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index 794919c..c8602f3 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -182,6 +182,9 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock,
return nil, warnings, err
}
if len(sblockHosts) > 0 {
+ if tlsApp.Automation == nil {
+ tlsApp.Automation = new(caddytls.AutomationConfig)
+ }
tlsApp.Automation.Policies = append(tlsApp.Automation.Policies, caddytls.AutomationPolicy{
Hosts: sblockHosts,
ManagementRaw: caddyconfig.JSONModuleObject(mm, "module", mm.(caddy.Module).CaddyModule().ID(), &warnings),