summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2022-04-26 00:00:39 -0400
committerGitHub <noreply@github.com>2022-04-25 22:00:39 -0600
commitd543ad1ffd81e12476378fd1bfe2e8afbf562506 (patch)
treeb2ad06ec0c017c75268cb873ebba98878ee9fd35
parenta8bb4a665af358f61a7ac0eabac8df2110cb6a36 (diff)
caddypki: Fix `caddy trust` command to use the correct API endpoint (#4730)
-rw-r--r--modules/caddypki/command.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/caddypki/command.go b/modules/caddypki/command.go
index 9b64c61..c26c19a 100644
--- a/modules/caddypki/command.go
+++ b/modules/caddypki/command.go
@@ -133,7 +133,7 @@ func cmdTrust(fl caddycmd.Flags) (int, error) {
ca := CA{
log: caddy.Log(),
root: rootCert,
- rootCertPath: adminAddr + path.Join(adminPKIEndpointBase, caID, "certificates"),
+ rootCertPath: adminAddr + path.Join(adminPKIEndpointBase, "ca", caID),
}
// Install the cert!
@@ -207,7 +207,7 @@ func cmdUntrust(fl caddycmd.Flags) (int, error) {
// rootCertFromAdmin makes the API request to fetch the root certificate for the named CA via admin API.
func rootCertFromAdmin(adminAddr string, caID string) (*x509.Certificate, error) {
- uri := path.Join(adminPKIEndpointBase, caID, "certificates")
+ uri := path.Join(adminPKIEndpointBase, "ca", caID)
// Make the request to fetch the CA info
resp, err := caddycmd.AdminAPIRequest(adminAddr, http.MethodGet, uri, make(http.Header), nil)