Software⏱️ 2 min read📅 2026-06-03

How to Fix: How to fix the "java.security.cert.CertificateException: No subject alternative names present" error?

Java web service client throws CertificateException when connecting to HTTPS service. Solution involves configuring the truststore or using a different keystore.

Quick Answer: Configure the truststore with the server's certificate or use a different keystore that includes the required subject alternative names.

The "java.security.cert.CertificateException: No subject alternative names present" error occurs when the Java client cannot verify the hostname of the server through the SSL/TLS certificate. This issue is commonly encountered when the server's hostname does not match the one specified in the certificate.

✅ Best Solutions to Fix It

Method 1: Update Server's Hostname

  1. Step 1: Check the server's hostname configuration and update it to match the one specified in the certificate.

Method 2: Use Java Property

  1. Step 1: Set the java.net.useSystemProxies property to false in your Java application configuration.

💡 Conclusion

By implementing these solutions, you should be able to resolve the "java.security.cert.CertificateException: No subject alternative names present" error and successfully connect to your HTTPS web service.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions