Calling WS with SSL in java -
i connect web service client work fine:
wscsi wscs = new wscsi("http://localhost:8080/servicev2/services/wscsisoap?wsdl","wscsi","wscsisoap"); iscoring instance = new scoringcfa(wscs); assertequals(true, instance.statusservice());
i need use ssl, change url to: https://localhost:8181/servicev2/services/wscsisoap?wsdl
and add in vm options:
-djavax.net.ssl.truststore="c:\cacerts.jks"
('keytool -list -keystore "c:\cacerts.jks', when run command see certificate need there)
when run client error:
java.security.cert.certificateexception: no name matching localhost found.)
that's because cert you're using issued against specific hostname (www.myhost.com). try solution in article.
warned, code sample intended localhost testing, remove once move onto integration/assembly testing on proper server.
Comments
Post a Comment