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.
📋 Table of Contents
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
- Step 1: Check the server's hostname configuration and update it to match the one specified in the certificate.
Method 2: Use Java Property
- 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.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid