oven-sh/bun · error · TypeError

NAME_CONSTRAINTS_WITHOUT_SANS

NAME_CONSTRAINTS_WITHOUT_SANS

Error message

NAME_CONSTRAINTS_WITHOUT_SANS

What it means

The certificate contains name constraints but no Subject Alternative Names, making constraint checking inapplicable or contradictory. A CA restricted by name constraints signed a certificate with no SANs to apply them to.

Solutions

  1. Reissue the leaf certificate with explicit SANs
  2. Remove or correct name constraints on the CA if they are not intended
  3. Use a different CA without conflicting name constraints
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/http/error.rs:253 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/2f997fa0d4f68643. Report an issue: GitHub.

Appendix: source

Thrown at src/http/error.rs:253

    #[error("SUITE_B_INVALID_CURVE")]
    SUITE_B_INVALID_CURVE,
    #[error("SUITE_B_INVALID_SIGNATURE_ALGORITHM")]
    SUITE_B_INVALID_SIGNATURE_ALGORITHM,
    #[error("SUITE_B_LOS_NOT_ALLOWED")]
    SUITE_B_LOS_NOT_ALLOWED,
    #[error("SUITE_B_CANNOT_SIGN_P_384_WITH_P_256")]
    SUITE_B_CANNOT_SIGN_P_384_WITH_P_256,
    #[error("HOSTNAME_MISMATCH")]
    HOSTNAME_MISMATCH,
    #[error("EMAIL_MISMATCH")]
    EMAIL_MISMATCH,
    #[error("IP_ADDRESS_MISMATCH")]
    IP_ADDRESS_MISMATCH,
    #[error("INVALID_CALL")]
    INVALID_CALL,
    #[error("STORE_LOOKUP")]
    STORE_LOOKUP,
    #[error("NAME_CONSTRAINTS_WITHOUT_SANS")]
    NAME_CONSTRAINTS_WITHOUT_SANS,
    #[error("UNKNOWN_CERTIFICATE_VERIFICATION_ERROR")]
    UNKNOWN_CERTIFICATE_VERIFICATION_ERROR,
}

impl Error {
    #[allow(clippy::trivially_copy_pass_by_ref)]
    pub fn name(&self) -> &'static str {
        match self {
            Self::CompressionFailed => "CompressionFailed",
            Self::Aborted => "Aborted",
            Self::WriteFailed => "WriteFailed",
            Self::HTTP2RefusedStream => "HTTP2RefusedStream",
            Self::HTTP2ContentLengthMismatch => "HTTP2ContentLengthMismatch",
            Self::HTTP2FrameSizeError => "HTTP2FrameSizeError",
            Self::HTTP2ProtocolError => "HTTP2ProtocolError",
            Self::HTTP2FlowControlError => "HTTP2FlowControlError",
            Self::HTTP2EnhanceYourCalm => "HTTP2EnhanceYourCalm",

View on GitHub (pinned to 8c5296ac45)