TLS/SSL · ERR_TLS_CERT_ALTNAME_INVALID

TLS/SSL Error Code ERR_TLS_CERT_ALTNAME_INVALID

The certificate does not cover the hostname you requested.

fatalLast verified 2026-11-08Node.js TLS / OpenSSL
Quick answer

The certificate does not cover the hostname you requested.

CodeERR_TLS_CERT_ALTNAME_INVALID
ProductTLS/SSL
Company / originIETF · International standard
CategoryProtocols & Standards
Platform / versionsTLS 1.2, TLS 1.3 · OpenSSL / Node.js clients and servers
Severityfatal
Official sourceNode.js TLS / OpenSSL ↗
Last verified2026-11-08

What does TLS/SSL error ERR_TLS_CERT_ALTNAME_INVALID mean?

ERR_TLS_CERT_ALTNAME_INVALID is a Node.js error returned when the hostname is not present in the certificate's subjectAltName extension. It often happens when the certificate was issued for a different domain or only for the apex domain, not www.

Common causes

  • The certificate's SAN list does not include the exact hostname.
  • The client connects to an IP or alias that is not in the certificate.
  • The wrong virtual host or certificate is selected by SNI.

How to fix it

  1. Step 1

    Request a certificate that includes every hostname you serve, including www.

  2. Step 2

    Connect using the exact hostname in the certificate, not an alias or IP.

  3. Step 3

    Check the SNI virtual host configuration and the certificate SAN list.

When to escalate

Before you escalate: If the certificate looks valid in a browser but your client still fails, compare the trust store, SNI hostname, and TLS versions on both sides. Capture the openssl s_client output and the client error, then contact the certificate owner or platform support.

Related codes

CodeNameWhat it means
ERR_CERT_COMMON_NAME_INVALIDERR_CERT_COMMON_NAME_INVALIDThe certificate's name does not match the requested host.
CERT_HAS_EXPIREDCERT_HAS_EXPIREDThe server certificate is past its expiration date.
CERT_NOT_YET_VALIDCertificate Not Yet ValidThe certificate's validity period starts in the future.
DEPTH_ZERO_SELF_SIGNED_CERTDEPTH_ZERO_SELF_SIGNED_CERTThe server presented a self-signed certificate.
ERR_CERT_AUTHORITY_INVALIDERR_CERT_AUTHORITY_INVALIDThe certificate was issued by an untrusted authority.

Source & verification

This page was checked against Node.js TLS / OpenSSL on 2026-11-08. The code, product, and platform fields are kept separate from the explanation so corrections can be made without changing the URL.

Open Error Codes is independent and not affiliated with IETF. Always confirm destructive or security-sensitive steps with the official documentation.