summaryrefslogtreecommitdiffhomepage
path: root/modules/caddypki/adminapi.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddypki/adminapi.go')
-rw-r--r--modules/caddypki/adminapi.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/caddypki/adminapi.go b/modules/caddypki/adminapi.go
index 435af349a..c454f6458 100644
--- a/modules/caddypki/adminapi.go
+++ b/modules/caddypki/adminapi.go
@@ -50,8 +50,11 @@ func (a *adminAPI) Provision(ctx caddy.Context) error {
a.ctx = ctx
a.log = ctx.Logger(a) // TODO: passing in 'a' is a hack until the admin API is officially extensible (see #5032)
- // Avoid initializing PKI if it wasn't configured
- if pkiApp := a.ctx.AppIfConfigured("pki"); pkiApp != nil {
+ // Avoid initializing PKI if it wasn't configured.
+ // We intentionally ignore the error since it's not
+ // fatal if the PKI app is not explicitly configured.
+ pkiApp, err := ctx.AppIfConfigured("pki")
+ if err == nil {
a.pkiApp = pkiApp.(*PKI)
}