Skip to main content

Https connection into jslee Project

2 replies [Last post]
astile
Offline
Joined: 2007-08-01

Hi all, I've developed a JSLEE Project which must create an https connection to a secure serrver. I've imported the server self-sgned certificate in my keystore and used the followwing System.setProperty in my code:
System.setProperty("javax.net.ssl.keyStore","c:/mykeystore/webclient_keystore");
but when I run the service I have the following error:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
It iseams like there isn't valid certification into webclient_keystore, but I'm sure that webclient_keystore contains a valid certification because I've tested it with a java application that make an https connection to my server.
how can I use a keystore into a JSLEE Project?
Best regards
Alessandro Stile

Message was edited by: astile

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
noletolucas
Offline
Joined: 2006-07-07

For standard java projects here's the solution:

http://forums.java.net/jive/message.jspa?messageID=358608#358608

1-
On you shell:
keytool.exe -import -file c:\publicCert.crt -keystore c:\mykeystore
(it will prompt for a password)

2-
On your Java client:
System.setProperty("javax.net.ssl.trustStore", "c:/mykeystore");
System.setProperty("javax.net.ssl.trustStorePassword", "thePassword");

Message was edited by: noletolucas

noletolucas
Offline
Joined: 2006-07-07

any luck?
stuck with the same probl.