caddyserver/caddy · error
PEM pair %d: %v
Error message
PEM pair %d: %v
What it means
Error "PEM pair %d: %v" thrown in caddyserver/caddy.
Source
Thrown at modules/caddytls/pemloader.go:80
// The certificate (public key) in PEM format.
CertificatePEM string `json:"certificate"`
// The private key in PEM format.
KeyPEM string `json:"key"`
// Arbitrary values to associate with this certificate.
// Can be useful when you want to select a particular
// certificate when there may be multiple valid candidates.
Tags []string `json:"tags,omitempty"`
}
// LoadCertificates returns the certificates contained in pl.
func (pl PEMLoader) LoadCertificates() ([]Certificate, error) {
certs := make([]Certificate, 0, len(pl))
for i, pair := range pl {
cert, err := tls.X509KeyPair([]byte(pair.CertificatePEM), []byte(pair.KeyPEM))
if err != nil {
return nil, fmt.Errorf("PEM pair %d: %v", i, err)
}
certs = append(certs, Certificate{
Certificate: cert,
Tags: pair.Tags,
})
}
return certs, nil
}
// Interface guard
var (
_ CertificateLoader = (PEMLoader)(nil)
_ caddy.Provisioner = (PEMLoader)(nil)
)
View on GitHub (pinned to 50e54ee279)
Solutions
- Fix the PEM certificate/key pair at the given index; the wrapped error explains the failure.
When it happens
Trigger: Thrown at modules/caddytls/pemloader.go:80 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/1cb0d37762b53e15.
Report an issue: GitHub.