Skip to content
MtrXTools

No subject alternative DNS name matching example.com found

The certificate doesn't cover this hostname

Seen in Java (java.security.cert.CertificateException), Spring, Android

Java received a certificate that does not list the hostname or IP address it connected to.

Common causes

  • The certificate does not include this name (www, apex or subdomain).
  • Connecting by IP address to a certificate that has no IP entries.
  • An internal certificate with only a common name and no subject alternative names.

How to fix it

  1. Reissue the certificate with the name or IP in its subject alternative names.
  2. Connect using a hostname the certificate covers.
  3. For internal CAs, include SANs when signing (for example -ext SAN=dns:host,ip:10.0.0.5 with keytool).
See the names on the certificate

Got a different message? Paste it into the error explainer.

Related errors

All 32 Languages & runtimes errors