I'm getting the following exception while accessing my webservice using
https client (no client-authentication)
javax.xml.rpc.ServiceException: Error processing WSDL document:
java.io.IOException: HTTPS hostname wrong: should be <localhost>
at org.apache.axis.client.Service.initService(Service.java:278)
at org.apache.axis.client.Service.<init>(Service.java:193)
at
org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java:
232)
The environment is:
JDK 1.4.2 on Windows XP
Tomcat 5.0.27
Axis 1.1
It works fine if I use http to access the service.
I'm able to retrieve the WSDL correctly using the browser:
https://localhost:8443/axis/services/HSMService?WSDL
I performed the following steps on tomcat:
- created a private key and cert and modified tomcat configuration to
allow SSL.
This is the code snippet on client side:
String urlString =
"https://localhost:8443/axis/services/HSMService?WSDL";
URL hsmServiceWsdlUrl = new URL(urlString);
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service hsmServiceService =
serviceFactory.createService(hsmServiceWsdlUrl,
new QName(nameSpaceUri, serviceName));
To run the client, I'm providing the following JVM args:
-Djavax.net.ssl.trustStore=client_keystore
-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
Am I missing something? Would appreciate your help.
Thanks