A: 

You have to set the keyStore and other variables when running the application, using

-Djavax.net.ssl.keyStore=path/to/keystore.jks
Bozho
im not sure what else i can try - ive got the java.home value as C:\Program Files (x86)\Java\jdk1.6.0_17\jre now even if i store the two files here and run this: System.setProperty("javax.net.ssl.keyStore", "/java.home/keystore.jks"); System.setProperty("javax.net.ssl.trustStrore", "/java.home/cacerts.jks");it still doesnt find them...
oneAday
java.home isn't resolved as a path. you can get it via System.getProperty("java.home"), but it isn't advisable to put the keystore there. Besides, I've given you three options - try them.
Bozho
i've tried using both - the first doesnt work and second method throws a null pointer exception - ive added the code and the debug info above.ive stored the files at both of these locations (which show up as the classpath): C:\Users\Main\Documents\NetBeansProjects\sslTest\build\classes;C:\Users\Main\Documents\NetBeansProjects\sslTest\srcany ideas whats going wrong?thanks!!
oneAday
how doesn't the first one work?
Bozho
If i add these lines: System.setProperty("javax.net.ssl.keyStore", "C:/Users/Main/Documents/NetBeansProjects/sslTest/stores/keystore.jks"); System.setProperty("javax.net.ssl.trustStrore", "C:/Users/Main/Documents/NetBeansProjects/sslTest/stores/cacerts.jks");I still get the same error - namely:run:classpath: C:\Users\Main\Documents\NetBeansProjects\sslTest\build\classes;C:\Users\Main\Documents\NetBeansProjects\sslTest\srcjavax.net.ssl.trustStore is not definedBUILD SUCCESSFUL (total time: 0 seconds)
oneAday
@oneAday - I notice that your comment says you set a property called "javax.net.ssl.trustStrore". Close ... but no cigar.
Stephen C
hahhaa, yeah - you make a point there :)
oneAday
+4  A: 

Looks like you have a typo -- "trustStrore" should be "trustStore", i.e. System.setProperty("javax.net.ssl.trustStrore", "cacerts.jks"); should be: System.setProperty("javax.net.ssl.trustStore", "cacerts.jks");

Don Isenor