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.
verify error:num=62:Hostname mismatchVerify return code: 62 (Hostname mismatch)Hostname mismatch OpenSSLverify error Hostname mismatch 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
- Reissue with the correct SAN entries
- Use the hostname that matches
- Add an IP SAN for IP-based access
Detailed fix by platform
Shell
- bash
openssl x509 -in cert.pem -noout -ext subjectAltName openssl s_client -connect host:443 -verify_hostname www.example.com
How to diagnose
- SAN — Contains hostname?
- Connection — By name?
- 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:
Similar errors
- 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
- apex Wildcard certificate *.example.com doesn't cover example.com (the bare domain)
- cert mismatch SMTP TLS certificate verification failed: hostname mismatch / unable to get local issuer (mail client or library)
Most viewed in SSL / TLS
- HTTPSConnectionPool: Max retries exceeded (SSLError) Python requests: HTTPSConnectionPool(host='api.example.com', port=443): Max retries exceeded with url: /v1 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] ...')))
- DST Root CA X3 expired (old clients fail) Old clients: certificate has expired — Let's Encrypt chain uses expired DST Root CA X3 (OpenSSL 1.0.x, Android < 7.1.1)
- Keystore was tampered with, or password was incorrect Java keytool: java.io.IOException: Keystore was tampered with, or password was incorrect
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 18 Nov 2026