The error message says wrong hostname, it is not true, when i try to send web service request to this ip address endpoint using SOAPUI, it works, but it throws error in my Java web service client. Some one please help.
Since you use HTTPS, Java will verify the host name against the CN in the certificate.
I suspect that the CN in the certificate is the host name and in this case requests will work.
When you change it to the IP, it will not match the CN and thus fails.
There is a way to work around this during development by including the following code block in the client of the web service:
In your case, you should either insert the IP instead of localhost in the verify method, or modify the method to always return true.
Hope this solves your problems!
Joined: Sep 27, 2008
Thanks a million, This issue was splitting my head for days.
Setting verify method in the client to always return true worked. Now i am able to use ip addresses instead of server names.