{"record":{"id":"298cddd79b12e436","repo":"slackhq/nebula","slug":"error-while-parsing-ca-crt-s","errorCode":null,"errorMessage":"error while parsing ca-crt: %s","messagePattern":"error while parsing ca-crt: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/nebula-cert/sign.go","lineNumber":183,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t\tcurve, caKey, _, err = cert.DecryptAndUnmarshalSigningPrivateKey(passphrase, rawCAKey)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error while parsing encrypted ca-key: %s\", err)\n\t\t\t}\n\t\t} else if err != nil {\n\t\t\treturn fmt.Errorf(\"error while parsing ca-key: %s\", err)\n\t\t}\n\t}\n\n\trawCACert, err := readInput(\"ca-crt\", *sf.caCertPath, &claims)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error while reading ca-crt: %s\", err)\n\t}\n\n\tcaCert, _, err := cert.UnmarshalCertificateFromPEM(rawCACert)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error while parsing ca-crt: %s\", err)\n\t}\n\n\tif !isP11 {\n\t\tif err := caCert.VerifyPrivateKey(curve, caKey); err != nil {\n\t\t\treturn fmt.Errorf(\"refusing to sign, root certificate does not match private key\")\n\t\t}\n\t}\n\n\tif caCert.Expired(time.Now()) {\n\t\treturn fmt.Errorf(\"ca certificate is expired\")\n\t}\n\n\tif version == 0 {\n\t\tversion = caCert.Version()\n\t}\n\n\t// if no duration is given, expire one second before the root expires\n\tif *sf.duration <= 0 {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/cmd/nebula-cert/sign.go#L165-L201","documentation":"Wrapping error in signCert: cert.UnmarshalCertificateFromPEM could not parse the CA certificate bytes from the ca-crt input. The file was read but is not a valid Nebula certificate (wrong PEM banner, corruption, or unrecognized version); cause included via %s.","triggerScenarios":"Thrown at cmd/nebula-cert/sign.go:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the ca-crt file is a certificate produced by nebula-cert ca","Re-export or regenerate the CA certificate","Check for truncation or copy/paste corruption of the PEM"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}