Sunday, 15 May 2011

Client side SSL with Spring-WS -



Client side SSL with Spring-WS -

i'm trying utilize mutual authentication (certs on both client , server) i'm getting error: javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target

then found class tried utilize messagesender: httpsurlconnectionmessagesender

but can't figure out how setup keystores , truststores have configure javax.net.ssl properties. if possible setup in spring xml files can dynamically configured.

checkout here.

you have generate certificate , place in jre library path , no need utilize message sender.

http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/

certificate generator https://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/installcert.java

then if face exception java.security.cert.certificateexception

then override verifier static { httpsurlconnection.setdefaulthostnameverifier(new hostnameverifier() { public boolean verify(string hostname, sslsession session) { // host_address = endpoint host address if (hostname.equals(host_address)) homecoming true; homecoming false; } }); }

ssl spring-ws

No comments:

Post a Comment