diff options
author | Francis Lavoie <lavofr@gmail.com> | 2021-12-13 14:25:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 12:25:35 -0700 |
commit | c04d24cafa60e522842d5188587ab07af2082e9b (patch) | |
tree | 47037af1a6cee638f054f3b3e4a9358970f5266a /modules/caddypki/acmeserver | |
parent | 81ee34e9623c3ac630f46c81a26e7823d0b2bf7b (diff) |
pki: Avoid provisioning the `local` CA when not necessary (#4463)
* pki: Avoid provisioning the `local` CA when not necessary
* pki: Refactor CA loading to keep the logic in the PKI app
Diffstat (limited to 'modules/caddypki/acmeserver')
-rw-r--r-- | modules/caddypki/acmeserver/acmeserver.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/caddypki/acmeserver/acmeserver.go b/modules/caddypki/acmeserver/acmeserver.go index 42d8cc4..388aa52 100644 --- a/modules/caddypki/acmeserver/acmeserver.go +++ b/modules/caddypki/acmeserver/acmeserver.go @@ -102,9 +102,9 @@ func (ash *Handler) Provision(ctx caddy.Context) error { return err } pkiApp := appModule.(*caddypki.PKI) - ca, ok := pkiApp.CAs[ash.CA] - if !ok { - return fmt.Errorf("no certificate authority configured with id: %s", ash.CA) + ca, err := pkiApp.GetCA(ash.CA, &ctx) + if err != nil { + return err } database, err := ash.openDatabase() |