title: Copying java keystore
body: <p>I have a valid keystore on my local development machine, which contains a certificate for accessing a webservice via HTTPS.</p>
  
  <p>I access this keystore in my project via:</p>
  
  <pre><code>System.setProperty("javax.net.ssl.truststore", "C:\\&lt;workspaceprojectPath&gt;\\SIPkeystore\\truststore.jks"); // sollte wohl auch ohne Keystore klappen
  System.setProperty("javax.net.ssl.keyStore", "C:\\&lt;workspaceprojectPath&gt;\\SIPkeystore\\SIPkeystore.jks");  
  System.setProperty("javax.net.ssl.keyStorePassword", "SECRET");
  </code></pre>
  
  <p>Now I want to access that certificate from another project. There I provide the same (full) path to the keystore in the other (local) project directory.</p>
  
  <p>Apparently the path is still found by the jvm and the property is being set, but on accessing the web service I get the same error message as if I hadn't added the keystore at all.</p>
  
  <p>When trying run the application I get a </p>
  
  <pre><code>sun.security.validator.ValidatorException: PKIX path building failed:   
       sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid 
       certification path to requested target
  </code></pre>
  
  <p>Is there a possibility to copy an existing keystore? This will be important also, when we deploy the application to our server. The application will run as stand-alone jar. (no web server)</p>
  
  <p><strong>EDIT:</strong>
  Ok, copying the keystore does not seem to be the problem, as I am able to run the original application while using a local copy of the original keystore files. It seems like it is a configuration issue.</p>