mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-27 02:33:48 +08:00
caddypki: Fix caddy trust
command to use the correct API endpoint (#4730)
This commit is contained in:
parent
a8bb4a665a
commit
d543ad1ffd
|
@ -133,7 +133,7 @@ func cmdTrust(fl caddycmd.Flags) (int, error) {
|
||||||
ca := CA{
|
ca := CA{
|
||||||
log: caddy.Log(),
|
log: caddy.Log(),
|
||||||
root: rootCert,
|
root: rootCert,
|
||||||
rootCertPath: adminAddr + path.Join(adminPKIEndpointBase, caID, "certificates"),
|
rootCertPath: adminAddr + path.Join(adminPKIEndpointBase, "ca", caID),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install the cert!
|
// 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.
|
// 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) {
|
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
|
// Make the request to fetch the CA info
|
||||||
resp, err := caddycmd.AdminAPIRequest(adminAddr, http.MethodGet, uri, make(http.Header), nil)
|
resp, err := caddycmd.AdminAPIRequest(adminAddr, http.MethodGet, uri, make(http.Header), nil)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user