oven-sh/bun · error · http::Error

ERR_TLS_CERT_ALTNAME_INVALID

ERR_TLS_CERT_ALTNAME_INVALID

Error message

ERR_TLS_CERT_ALTNAME_INVALID

What it means

TLS certificate hostname verification failed. The server's certificate does not contain a Subject Alternative Name (SAN) or Common Name matching the hostname used to connect, mirroring Node.js ERR_TLS_CERT_ALTNAME_INVALID.

Solutions

  1. Verify the hostname in the request URL matches the certificate's SAN entries
  2. Regenerate the server certificate with the correct hostname in its SANs
  3. For development only, use a custom CA or disable hostname verification (not recommended for production)
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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

Appendix: source

Thrown at src/http/error.rs:36

    #[error("HTTP2FlowControlError")]
    HTTP2FlowControlError,
    #[error("HTTP2EnhanceYourCalm")]
    HTTP2EnhanceYourCalm,
    #[error("HTTP2HeaderListTooLarge")]
    HTTP2HeaderListTooLarge,
    #[error("HTTP2StreamReset")]
    HTTP2StreamReset,
    #[error("HTTP2GoAway")]
    HTTP2GoAway,
    #[error("HTTP2CompressionError")]
    HTTP2CompressionError,
    #[error("Timeout")]
    Timeout,
    #[error("AbortedBeforeConnecting")]
    AbortedBeforeConnecting,
    #[error("InvalidURL")]
    InvalidURL,
    #[error("ERR_TLS_CERT_ALTNAME_INVALID")]
    ERR_TLS_CERT_ALTNAME_INVALID,
    #[error("ClientAborted")]
    ClientAborted,
    #[error("HTTP2Unsupported")]
    HTTP2Unsupported,
    #[error("ConnectionClosed")]
    ConnectionClosed,
    #[error("DNSResolveFailed")]
    DNSResolveFailed,
    #[error("ConnectionRefused")]
    ConnectionRefused,
    #[error("TooManyRedirects")]
    TooManyRedirects,
    #[error("HTTP3Unsupported")]
    HTTP3Unsupported,
    #[error("ResponseHeadersTooLarge")]
    ResponseHeadersTooLarge,
    #[error("UnrequestedUpgrade")]

View on GitHub (pinned to 8c5296ac45)