{"record":{"id":"1cb0d37762b53e15","repo":"caddyserver/caddy","slug":"pem-pair-d-v","errorCode":null,"errorMessage":"PEM pair %d: %v","messagePattern":"PEM pair (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddytls/pemloader.go","lineNumber":80,"sourceCode":"\t// The certificate (public key) in PEM format.\n\tCertificatePEM string `json:\"certificate\"`\n\n\t// The private key in PEM format.\n\tKeyPEM string `json:\"key\"`\n\n\t// Arbitrary values to associate with this certificate.\n\t// Can be useful when you want to select a particular\n\t// certificate when there may be multiple valid candidates.\n\tTags []string `json:\"tags,omitempty\"`\n}\n\n// LoadCertificates returns the certificates contained in pl.\nfunc (pl PEMLoader) LoadCertificates() ([]Certificate, error) {\n\tcerts := make([]Certificate, 0, len(pl))\n\tfor i, pair := range pl {\n\t\tcert, err := tls.X509KeyPair([]byte(pair.CertificatePEM), []byte(pair.KeyPEM))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"PEM pair %d: %v\", i, err)\n\t\t}\n\t\tcerts = append(certs, Certificate{\n\t\t\tCertificate: cert,\n\t\t\tTags:        pair.Tags,\n\t\t})\n\t}\n\treturn certs, nil\n}\n\n// Interface guard\nvar (\n\t_ CertificateLoader = (PEMLoader)(nil)\n\t_ caddy.Provisioner = (PEMLoader)(nil)\n)\n","sourceCodeStart":62,"sourceCodeEnd":95,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddytls/pemloader.go#L62-L95","documentation":"Error \"PEM pair %d: %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddytls/pemloader.go:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the PEM certificate/key pair at the given index; the wrapped error explains the failure."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}