How can I fixed the SSLException in AM?

120 Views Asked by At

I invoked the API by postman successfully but did not in HttpClient as the shown below. And there are no logs in wso2carbon.log or error.log

javax.net.ssl.SSLException: hostname in certificate didn't match: <14.201.60.216> != <localhost>

and Do I have to generate my own KeyStore if I want to use httpclient to inovke the linux's API?

2

There are 2 best solutions below

1
On

You will have to create a new keystore with CN as your domain. Follow this tutorial https://medium.com/@dunithd/wso2-das-how-to-fix-javax-net-ssl-sslexception-160c13bc8fe7#.tgh16eu4s

5
On

You can disable the Hostname verification. To do that set the following property when starting the server

-Dhttpclient.hostnameVerifier=AllowAll

You can refer to https://docs.wso2.com/display/ADMIN44x/Enabling+HostName+Verification