CertificateException: No name matching

Problem

After installing a custom certificate in JVM, the connection setup failed with the following error message:

CertificateException: No name matching

Cause

The provided certificate has a host name mismatch or was generated without a host name. 

Solution

  • Check the certificate using
    openssl s_client -connect <ip>:<port> | openssl x509 -text -noout
  • Provide the correct certificate.