I am getting this \'HTTPS hostname wrong:\' error when trying to connect to a server using https. My url looks something like this
https://sub.domain.com/tam
Java by default verifies that the certificate CN (Common Name) is the same as hostname in the URL. If the CN in the certificate is not the same as the host name, your web service client fails with the following exception: java.io.IOException: HTTPS hostname wrong: should be hostname as in the certificates.