2

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?

Community
  • 1
  • 1
Mike
  • 419
  • 1
  • 6
  • 16

2 Answers2

2

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

1

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

Chamila Adhikarinayake
  • 3,588
  • 5
  • 25
  • 32
  • I did the above as you say. Although,There is no sslexception,But the API was not invoked by postman or httpclient. It prompted that curl: (7) Failed to connect to www.test.foo.com port 8243: Connection timed out – Mike Jan 09 '17 at 15:33