error 62 SSL / TLS Origin: Network OSI layer 6 · Presentation Last updated 18 Nov 2026

openssl verify error:num=62:Hostname mismatch / Verify return code: 62

The certificate is valid but not for the hostname you connected to or asked OpenSSL to check.

Exact message you may see verify error:num=62:Hostname mismatchVerify return code: 62 (Hostname mismatch)Hostname mismatch OpenSSLverify error Hostname mismatch
Seen on: OpenSSL SSL

Meaning

Check the SAN list (openssl x509 -noout -ext subjectAltName), connect with the exact hostname (and -verify_hostname), and note that the Common Name is ignored when SANs exist. IP connections need an IP SAN.

Common causes

  • Hostname not in the SAN list
  • Connecting via IP or alias
  • Wildcard doesn't cover the level
  • Wrong certificate deployed
  • Old CN-only certificate

⚡ Quick fix

  1. Reissue with the correct SAN entries
  2. Use the hostname that matches
  3. Add an IP SAN for IP-based access

Detailed fix by platform

Shell

  1. bash
    openssl x509 -in cert.pem -noout -ext subjectAltName
    openssl s_client -connect host:443 -verify_hostname www.example.com

How to diagnose

  1. SAN — Contains hostname?
  2. Connection — By name?
  3. Wildcard — Right level?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

AH01909: server certificate does NOT include an ID which matches the server name — Apache: [ssl:warn] AH01909: example.com:443:0 server certificate does NOT include an ID which matches the server name (SSL / TLS)AH01909: server certi…apex — Wildcard certificate *.example.com doesn't cover example.com (the bare domain) (SSL / TLS)apexcert mismatch — SMTP TLS certificate verification failed: hostname mismatch / unable to get local issuer (mail client or library) (Email / SMTP)cert mismatchDjango — Django send_mail: ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] (EMAIL_USE_SSL vs EMAIL_USE_TLS on the wrong port) (Email / SMTP)DjangoHELO — 504 5.5.2 Helo command rejected: need fully-qualified hostname (invalid EHLO name) (Email / SMTP)HELOhostname — Java: SSLPeerUnverifiedException — Certificate for <host> doesn't match any of the subject alternative names (SSL / TLS)hostnamelegacy CN — Go: x509: certificate relies on legacy Common Name field, use SANs instead (SSL / TLS)legacy CNNET::ERR_CERT_COMMON_NAME_INVALID — NET::ERR_CERT_COMMON_NAME_INVALID: Your connection is not private (certificate is for a different domain) (SSL / TLS)NET::ERR_CERT_COMMON_…error 62

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.