'Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching
I have requirement where I need to migrate from Spring to SpringBoot application. Currently having SOAP service which internally connecting to https REST api that included in application.properties file. I am using command clean package spring-boot:run which build application successfully.
But when try to call SOAP services, getting error Caused by:
java.security.cert.CertificateException: No subject alternative DNS name matching momgodbservice.nam.nsroot.net found.
Solution 1:[1]
java.security.cert.CertificateException: No subject alternative DNS name matching found
Cause:
There can be multiple causes to this issue.
Application may check the hostname on SSL certificates when communicating with an LDAP server over SSL. What this means is that the hostname used to connect to the LDAP server must match that of the SSL certificate, or application will not be able to connect to the directory.
The exception is thrown when you are trying to make a secure connection over SSL and the hostname you are trying to connect is not valid when compared to the SSL certificate of the server.
Solution 2:[2]
I had the same issue as OP. For me there was no LDAP server anywhere in the architecture.
I had a wildcard SSL cert on the AWS load balancer: *.mydomain.com. I added the specific domain names that the application was using to the same SSL cert so it had three entries: *.mydomain.com, qa.api.myapp.mydomain.com and api.myapp.mydomain.com. Once this cert was on the load balancer where SSL was terminated, the java application worked flawlessly (at least from an SSL perspective) Timothy
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mebin Joe |
| Solution 2 | Dharman |
