caddyserver/caddy · error
requesting CA info
Error message
requesting CA info: %v
What it means
rootCertFromAdmin wraps a failure of caddycmd.AdminAPIRequest when GETting the admin API endpoint for the named CA: the admin server was unreachable, rejected the request, or returned an error status, so the root certificate needed by caddy trust/untrust cannot be fetched.
Solutions
- Ensure the Caddy admin endpoint is reachable and the PKI app is configured, then retry.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at modules/caddypki/command.go:213 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of caddyserver/caddy@50e54ee279 (2026-08-15).
Data as JSON: /api/errors/8f5383904e627fed.
Report an issue: GitHub.
Appendix: source
Thrown at modules/caddypki/command.go:213
err = truststore.Uninstall(rootCert,
truststore.WithDebug(),
truststore.WithFirefox(),
truststore.WithJava())
if err != nil {
return caddy.ExitCodeFailedStartup, fmt.Errorf("failed to uninstall certificate file: %v", err)
}
return caddy.ExitCodeSuccess, nil
}
// 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, "ca", caID)
// Make the request to fetch the CA info
resp, err := caddycmd.AdminAPIRequest(adminAddr, http.MethodGet, uri, make(http.Header), nil)
if err != nil {
return nil, fmt.Errorf("requesting CA info: %v", err)
}
defer resp.Body.Close()
// Decode the response
caInfo := new(caInfo)
err = json.NewDecoder(resp.Body).Decode(caInfo)
if err != nil {
return nil, fmt.Errorf("failed to decode JSON response: %v", err)
}
// Decode the root cert
rootBlock, _ := pem.Decode([]byte(caInfo.RootCert))
if rootBlock == nil {
return nil, fmt.Errorf("failed to decode root certificate: %v", err)
}
rootCert, err := x509.ParseCertificate(rootBlock.Bytes)
if err != nil {
return nil, fmt.Errorf("failed to parse root certificate: %v", err)View on GitHub (pinned to 50e54ee279)