{"record":{"id":"f331859a9cc10fc2","repo":"slackhq/nebula","slug":"pki-use-of-s-is-not-allowed-in-fips-140-only-mod","errorCode":null,"errorMessage":"pki: use of %s is not allowed in FIPS 140-only mode","messagePattern":"pki: use of (.+?) is not allowed in FIPS 140-only mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pki.go","lineNumber":341,"sourceCode":"\t\tpubPathOrPEM = \"<inline>\"\n\n\t} else {\n\t\trawCert, err = os.ReadFile(pubPathOrPEM)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to read pki.cert file %s: %s\", pubPathOrPEM, err)\n\t\t}\n\t}\n\n\tvar crt, v1, v2 cert.Certificate\n\tfor {\n\t\t// Load the certificate\n\t\tcrt, rawCert, err = loadCertificate(rawCert)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif fips140.Enforced() && crt.Curve() != cert.Curve_P256 {\n\t\t\treturn nil, fmt.Errorf(\"pki: use of %s is not allowed in FIPS 140-only mode\", crt.Curve())\n\t\t}\n\n\t\tswitch crt.Version() {\n\t\tcase cert.Version1:\n\t\t\tif v1 != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"v1 certificate already found in pki.cert\")\n\t\t\t}\n\t\t\tv1 = crt\n\t\tcase cert.Version2:\n\t\t\tif v2 != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"v2 certificate already found in pki.cert\")\n\t\t\t}\n\t\t\tv2 = crt\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown certificate version %v\", crt.Version())\n\t\t}\n\n\t\tif len(rawCert) == 0 || strings.TrimSpace(string(rawCert)) == \"\" {","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/pki.go#L323-L359","documentation":"When FIPS 140-only mode is enforced, certificates must use NIST P-256. During pki.cert parsing, each loaded certificate whose curve is not P256 causes this error naming the offending curve, blocking startup.","triggerScenarios":"reloadCerts -> newCertStateFromConfig with fips140.Enforced() true and a certificate issued on Curve 25519 (or any non-P256 curve) in pki.cert.","commonSituations":"Running nebula under FIPS-enforced mode with pre-existing 25519 certificates; mixed fleets where certs were re-issued with curve 25519; testing FIPS mode against default-issued certs; distro/build with FIPS 140 enforcement enabled unexpectedly.","solutions":["Re-issue the certificate (and CA) with P-256 key via `nebula-cert` and update pki.cert/ca.crt.","Disable FIPS 140 enforcement if P-256 migration isn't possible and policy allows.","Audit all certs in the pki.cert chain — every cert in the file must be P256 in FIPS mode.","Note FIPS mode also forbids chachapoly ciphers; switch cipher to aes."],"exampleFix":"# before\nnebula-cert ca -name \"My Org\"   # defaults to 25519\n# after\nnebula-cert ca -name \"My Org\" -curve P256\nnebula-cert sign -ca-crt ca.crt -ca-key ca.key -name host -ip 10.0.0.1/24 -curve P256","handlingStrategy":"validation","validationCode":"// Before FIPS-mode rollout: verify all certs are P-256\nfunc checkCurvesFIPS(chain []byte) error {\n  rest := chain\n  for len(rest) > 0 {\n    var crt *x509.Certificate\n    crt, rest, _ = parseOne(rest)\n    if crt.Curve != elliptic.P256() {\n      return fmt.Errorf(\"cert %s uses non-P256 curve; FIPS mode forbids it\", crt.Subject)\n    }\n  }\n  return nil\n}","typeGuard":null,"tryCatchPattern":"cs, err := newCertStateFromConfig(...)\nif err != nil {\n  if strings.Contains(err.Error(), \"not allowed in FIPS 140-only mode\") {\n    return fmt.Errorf(\"re-issue certificates with -curve P256 before enabling FIPS enforcement: %w\", err)\n  }\n  return err\n}","preventionTips":["Standardize on P-256 certificates fleet-wide if FIPS mode is a possibility.","Pre-scan existing certs (`nebula-cert print` / openssl) before enabling FIPS 140 enforcement.","Remember FIPS mode also forbids chachapoly; pin cipher to aes in FIPS configs.","Re-issue CA and host certs together so chain versions/curves stay consistent."],"tags":["fips","certificate","curve","compliance"],"backgroundTag":"fips-curve-not-allowed","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"}