This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Feb 9, 2012, 4:01 PM
2 Posts

Added jar needs keystore, where to put?

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: jar java keystore
  • Replies: 2
 Hi there, 
 
im quite new to xpages...So im sorry for maybe asking a stupid question :)
 
What i have done:
 
I developed a class which makes some calls with a ssl certificate. In Eclipse i can add something like this to my runtime configuration:
-Djavax.net.ssl.trustStore="path\bas.keystore"
-Djavax.net.ssl.trustStorePassword="password"
 
I have created a jar file, added it to the WEB-INF\lib and set my class path. On my xpage i have a button which calls a function in a serverside javascript library, where i placed the call to my method in my jar file. When i open the page he says  No trusted certificate found. Which is understandable...
 
So, where should i place my keystore file and what do i have to have to change? 
 
Thanks for your help. 
Matthias 
Feb 10, 2012, 7:51 AM
9 Posts
Re: Added jar needs keystore, where to put?
 Should be in jam\lib\security. You need to make a copy of cacerts. 
 
You can probably take directions from this wiki article
Feb 14, 2012, 8:41 AM
2 Posts
Re: Added jar needs keystore, where to put?
 Hi there, 
 
i got it to work. 
First i had to save the keystore file in the security folder.
Then i added these entries to the java.policy file: 
permission java.util.PropertyPermission "javax.net.ssl.trustStore", "read,write";
permission java.util.PropertyPermission "javax.net.ssl.trustStorePassword", "read,write";
permission java.util.PropertyPermission "javax.net.ssl.keyStore", "read,write";
permission java.util.PropertyPermission "javax.net.ssl.keyStorePassword", "read,write";
permission  java.lang.RuntimePermission "setContextClassLoader";
 And i added following lines to my code:
 System.setProperty("javax.net.ssl.keyStore", ksLocation);
System.setProperty("javax.net.ssl.keyStorePassword",ksPassword);
System.setProperty("javax.net.ssl.trustStore", ksLocation);
System.setProperty("javax.net.ssl.trustStorePassword",ksPassword);
Maybe there's a better way, but it worked for me. 
 
Matthias 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal