cert mismatch Email / SMTP Origin: Network OSI layer 6 · Presentation Last updated 18 Nov 2026

SMTP TLS certificate verification failed: hostname mismatch / unable to get local issuer (mail client or library)

The client verified the mail server's certificate and it didn't match the host name or wasn't trusted.

Exact message you may see Hostname/IP does not match certificate's altnames SMTPcertificate verify failed: Hostname mismatch smtpSSL: certificate verify failed (SMTP)Error: Hostname/IP does not match certificate's altnames: Host: mail.example.com. is not in the cert's altnamesThe server's TLS certificate does not match
Seen on: SMTP SSL Email

Meaning

Connect using the exact host name in the certificate (e.g. smtp.provider.com, not a CNAME or IP), update the CA bundle, and make sure the server sends the full chain. Don't disable verification in production; for internal servers add the CA or a proper certificate.

Common causes

  • Connecting by IP/alias not in the certificate
  • Self-signed/internal CA certificate
  • Expired or incomplete chain
  • Old CA bundle
  • Provider certificate rotation

⚡ Quick fix

  1. Use the host name from the certificate SAN
  2. Install the CA or fix the chain
  3. Update the CA bundle/runtime

Detailed fix by platform

Shell

  1. openssl s_client -starttls smtp -connect smtp.example.com:587 -servername smtp.example.com 2>/dev/null | openssl x509 -noout -subject -ext subjectAltName

How to diagnose

  1. Host — In SAN?
  2. Chain — Complete?
  3. CA bundle — Current?

🔧 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):

530 — 530 5.7.0 Must issue a STARTTLS command first (TLS required before AUTH or sending) (Email / SMTP)530530 5.7.0 Authentication Required — SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required (Email / SMTP)530 5.7.0 Authenticat…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…clock — Certificate error caused by a wrong device clock (NET::ERR_CERT_DATE_INVALID, "your clock is ahead/behind") (SSL / TLS)clockerror 62 — openssl verify error:num=62:Hostname mismatch / Verify return code: 62 (SSL / TLS)error 62expiry — Certificate expired unexpectedly — manual renewal missed or automation failing silently (SSL / TLS)expiryHELO — 504 5.5.2 Helo command rejected: need fully-qualified hostname (invalid EHLO name) (Email / SMTP)HELOHTTPS scanning — Antivirus HTTPS/SSL scanning breaks certificates (Avast, Kaspersky, ESET, Bitdefender) (SSL / TLS)HTTPS scanningcert mism…

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.