{"record":{"id":"156e67feb767a692","repo":"oven-sh/bun","slug":"suite-b-cannot-sign-p-384-with-p-256","errorCode":"SUITE_B_CANNOT_SIGN_P_384_WITH_P_256","errorMessage":"SUITE_B_CANNOT_SIGN_P_384_WITH_P_256","messagePattern":"SUITE_B_CANNOT_SIGN_P_384_WITH_P_256","errorType":"error_code","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"src/http/error.rs","lineNumber":241,"sourceCode":"    #[error(\"UNSUPPORTED_CONSTRAINT_TYPE\")]\n    UNSUPPORTED_CONSTRAINT_TYPE,\n    #[error(\"UNSUPPORTED_CONSTRAINT_SYNTAX\")]\n    UNSUPPORTED_CONSTRAINT_SYNTAX,\n    #[error(\"UNSUPPORTED_NAME_SYNTAX\")]\n    UNSUPPORTED_NAME_SYNTAX,\n    #[error(\"CRL_PATH_VALIDATION_ERROR\")]\n    CRL_PATH_VALIDATION_ERROR,\n    #[error(\"SUITE_B_INVALID_VERSION\")]\n    SUITE_B_INVALID_VERSION,\n    #[error(\"SUITE_B_INVALID_ALGORITHM\")]\n    SUITE_B_INVALID_ALGORITHM,\n    #[error(\"SUITE_B_INVALID_CURVE\")]\n    SUITE_B_INVALID_CURVE,\n    #[error(\"SUITE_B_INVALID_SIGNATURE_ALGORITHM\")]\n    SUITE_B_INVALID_SIGNATURE_ALGORITHM,\n    #[error(\"SUITE_B_LOS_NOT_ALLOWED\")]\n    SUITE_B_LOS_NOT_ALLOWED,\n    #[error(\"SUITE_B_CANNOT_SIGN_P_384_WITH_P_256\")]\n    SUITE_B_CANNOT_SIGN_P_384_WITH_P_256,\n    #[error(\"HOSTNAME_MISMATCH\")]\n    HOSTNAME_MISMATCH,\n    #[error(\"EMAIL_MISMATCH\")]\n    EMAIL_MISMATCH,\n    #[error(\"IP_ADDRESS_MISMATCH\")]\n    IP_ADDRESS_MISMATCH,\n    #[error(\"INVALID_CALL\")]\n    INVALID_CALL,\n    #[error(\"STORE_LOOKUP\")]\n    STORE_LOOKUP,\n    #[error(\"NAME_CONSTRAINTS_WITHOUT_SANS\")]\n    NAME_CONSTRAINTS_WITHOUT_SANS,\n    #[error(\"UNKNOWN_CERTIFICATE_VERIFICATION_ERROR\")]\n    UNKNOWN_CERTIFICATE_VERIFICATION_ERROR,\n}\n\nimpl Error {","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/http/error.rs#L223-L259","documentation":"CertError::SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 maps BoringSSL X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 (verify code 61). Suite B forbids a P-256 issuer from signing a P-384 certificate: the signer's security level must not be below the signed cert's. Message: \"Suite B: cannot sign P-384 with P-256\".","triggerScenarios":"A chain where a P-256 CA certificate signs a P-384 leaf (or P-256 intermediate above a P-384 cert) while Suite B verification is enabled - e.g. reissuing a leaf 'stronger' than its parent CA.","commonSituations":"Operators upgrading leaf keys to P-384 without re-keying the intermediate; mixed hierarchies assembled from multiple CAs; test setups chaining arbitrary EC certs together.","solutions":["Re-key the issuing CA on P-384 (or reissue the child on P-256) so signer strength >= signed strength","Rebuild the full chain in one strength and re-verify: openssl verify -CAfile p384-root.pem -untrusted p384-int.pem leaf.pem","If Suite B is not a real requirement, drop the Suite B flags instead"],"exampleFix":"# before: P-256 intermediate signs a P-384 leaf\nopenssl x509 -req -in leaf-p384.csr -CA int-p256.pem ...\n\n# after: match strengths - P-384 signer\nopenssl ecparam -name secp384r1 -genkey -out int-key.pem\nopenssl x509 -req -in leaf-p384.csr -CA int-p384.pem ...","handlingStrategy":"validation","validationCode":"// Assert signer strength >= signed strength (no P-256 parent over P-384 child)\nimport { X509Certificate } from \"node:crypto\";\nexport function signerStrengthOk(childPem, parentPem) {\n  const rank = { \"P-256\": 1, \"P-384\": 2 };\n  const c = rank[new X509Certificate(childPem).keyObject.export({ format: \"jwk\" }).crv];\n  const p = rank[new X509Certificate(parentPem).keyObject.export({ format: \"jwk\" }).crv];\n  return p >= c;\n}","typeGuard":"export function isSuiteBCannotSignP384WithP256(e): e is Error & { code: \"SUITE_B_CANNOT_SIGN_P_384_WITH_P_256\" } {\n  return e instanceof Error && (e as any).code === \"SUITE_B_CANNOT_SIGN_P_384_WITH_P_256\";\n}","tryCatchPattern":"try {\n  await fetch(url);\n} catch (e) {\n  if (e?.code === \"SUITE_B_CANNOT_SIGN_P_384_WITH_P_256\") {\n    // P-256 issuer signed a P-384 cert - re-key the CA up to P-384 or reissue the child at P-256\n    rekeyHierarchy(url);\n  } else throw e;\n}","preventionTips":["Never upgrade leaf key strength without upgrading the issuing CA first","Add a signer-strength assertion to the CA's signing endpoint (reject child stronger than parent)","Keep hierarchy strength uniform - mixed-strength chains only work outside Suite B"],"tags":["tls","x509","suite-b","curves","pki","fetch","security"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}