{"record":{"id":"7af938e2958839b4","repo":"goharbor/harbor","slug":"invalid-ca-certificate-w","errorCode":null,"errorMessage":"invalid CA certificate: %w","messagePattern":"invalid CA certificate: %w","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"src/common/http/transport.go","lineNumber":121,"sourceCode":"func ValidateCACertificate(caCert string) error {\n\tcaCert = normalizePEM(caCert)\n\tif caCert == \"\" {\n\t\treturn nil\n\t}\n\n\t// Attempt to parse one or more certificates from the provided PEM\n\tcerts, err := parseCertificatesFromPEM(caCert)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid CA certificate: %w\", err)\n\t}","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/common/http/transport.go#L103-L139","documentation":"Validation in ValidateCACertificate: the supplied CA certificate string, after PEM normalization, could not be parsed as x509 certificate(s) — i.e. it is not valid PEM certificate data. %w wraps the parse error; it fires when a user supplies a corrupted, truncated, or non-PEM CA bundle (empty input is allowed).","triggerScenarios":"Thrown at src/common/http/transport.go:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the CA certificate as valid PEM (BEGIN/END CERTIFICATE blocks)","Check for corruption, truncation or wrong encoding (e.g. DER instead of PEM)","Re-export the CA certificate from the source authority"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}