title: Default SSL context init failed: null
body: <p>When creating a SSL server, I got this exception: <code>Default SSL context init failed: null</code>. It seems that it comes from the fact it can't find the keystore and truststore. I try to set them from a jar file. The file exists in the jar but it seems that the resource cannot be found.</p>
  
  <pre><code>String keystore = TestFramework.class.getResource("/security/keystore.jks").getFile();
  System.setProperty("javax.net.ssl.keyStore", keystore);
  System.setProperty("javax.net.ssl.keyStorePassword", password);
  String truststore = TestFramework.class.getResource("/security/truststore").getFile();
  System.setProperty("javax.net.ssl.trustStore", truststore);
  System.setProperty("javax.net.ssl.trustStorePassword", "ebxmlrr");
  </code></pre>
  
  <p>I ran a <code>ls</code> command to check if the file exists. It exists. Then I check if the keystore.jks exists by running the command <code>jar -tf myjar.jar | grep security</code> and it exists.</p>
  
  <pre><code>security/
  security/keystore.jks
  security/truststore
  </code></pre>
  
  <p>My application is running under Tomcat.</p>