Skip to content

Commit f8af2ee

Browse files
authored
Merge pull request #16 from nielsavonds/master
Bugfix: ObtainCert cannot look at the Managed flag, so we should do that instead
2 parents b5826ec + 7e0890f commit f8af2ee

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

caddynet/netserver/tls.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ func activateTLS(cctx caddy.Context) error {
2828
}
2929
}
3030

31-
// 3. Calls ObtainCert() for each config (this method only obtains certificates if the config qualifies and has its Managed field set to true).
31+
// 3. Calls ObtainCert() for each managed config.
3232
// place certificates and keys on disk
33-
for _, c := range ctx.configs {
34-
err := c.TLS.Manager.ObtainCert(c.TLS.Hostname, operatorPresent)
35-
if err != nil {
36-
return err
33+
for _, cfg := range ctx.configs {
34+
if cfg.TLS.Managed {
35+
err := cfg.TLS.Manager.ObtainCert(cfg.TLS.Hostname, operatorPresent)
36+
if err != nil {
37+
return err
38+
}
3739
}
3840

3941
}

0 commit comments

Comments
 (0)