Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 19:15 UTC
caddypki: Fix `caddy trust` command to use the correct API endpoint (#4730)
Francis Lavoie committed
Apr 26, 2022 at 00:00 UTC
d543ad1ffd81e12476378fd1bfe2e8afbf562506
1 file changed
+2
-2
modules/caddypki/command.go
+2
-2
@@ -133,7 +133,7 @@ func cmdTrust(fl caddycmd.Flags) (int, error) {
133
ca := CA{
134
log: caddy.Log(),
135
root: rootCert,
136
- rootCertPath: adminAddr + path.Join(adminPKIEndpointBase, caID, "certificates"),
136
+ rootCertPath: adminAddr + path.Join(adminPKIEndpointBase, "ca", caID),
137
}
138
139
// Install the cert!
@@ -207,7 +207,7 @@ func cmdUntrust(fl caddycmd.Flags) (int, error) {
207
208
// rootCertFromAdmin makes the API request to fetch the root certificate for the named CA via admin API.
209
func rootCertFromAdmin(adminAddr string, caID string) (*x509.Certificate, error) {
210
- uri := path.Join(adminPKIEndpointBase, caID, "certificates")
210
+ uri := path.Join(adminPKIEndpointBase, "ca", caID)
211
212
// Make the request to fetch the CA info
213
resp, err := caddycmd.AdminAPIRequest(adminAddr, http.MethodGet, uri, make(http.Header), nil)