I want to create a web service client using wsdl2java utility. I have to connect to this server over SSL
This wsdl looks like this:
https://xxx.xx.xx.xx:8443/api/wsdl/xxxxxxx.wsdl
I generated the certificate using:
openssl s_client -connect xxx.xx.xx.x:8443 </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > abcCertificate.pem
and added it to keystore using:
keytool -import -noprompt -trustcacerts -alias testcert -file abcCertificate.pem -keystore /usr/java/jdk1.7.0_06/jre/lib/security/cacerts -ext san=ip:xxx.xx.xx.xx
When I try to use wsdl2java
to create the web service client, it throws exception:
javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present
I use these information from this link.
NoopHostnameVerifier
, see https://mcmap.net/q/35994/-how-to-fix-the-quot-java-security-cert-certificateexception-no-subject-alternative-names-present-quot-error – Totality