title: Java exception client authentication TLS: password must not be null
body: <p>I wrote this code to communicate with <strong>ejbca server</strong> (<code>JBoss 5.1.0.GA-jdk6</code>, <code>EJBCA 4.0.10</code> and <code>openjdk-6-jdk</code> ):</p>
  <pre><code>CryptoProviderTools.installBCProvider();    
  String urlstr = &quot;https://ejbca05:8443/ejbca/ejbcaws/ejbcaws?wsdl&quot;;
  
  System.setProperty(&quot;javax.net.ssl.trustStore&quot;,&quot;C:\\Users\\l.\\keystore.jks&quot;); 
  System.setProperty(&quot;javax.net.ssl.trustStorePassword&quot;,&quot;provae&quot;); 
  System.setProperty(&quot;javax.net.ssl.keyStore&quot;,&quot;C:\\Users\\l.\\keystore.jks&quot;);
  System.setProperty(&quot;javax.net.sslews.keyStorePassword&quot;,&quot;provae&quot;); 
  QName qname = new QName(&quot;http://ws.protocol.core.ejbca.org/&quot;, &quot;EjbcaWSService&quot;);
  EjbcaWSService service = null;
  try {
      service = new EjbcaWSService(new URL(urlstr),qname);
  } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      System.out.println(&quot;errore nell'url&quot;);
  }
  EjbcaWS ejbcaraws = service.getEjbcaWSPort(); 
  </code></pre>
  <p>but I have this exception:</p>
  <pre><code>Exception in thread &quot;main&quot; javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://ejbca05:8443/ejbca/ejbcaws/ejbcaws?wsdl. It failed with: 
      Got java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext) while opening stream from https://ejbca05:8443/ejbca/ejbcaws/ejbcaws?wsdl.
      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:173)
  ..........
  .......
  Caused by: java.security.UnrecoverableKeyException: Password must not be null
      at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:124)
      at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java:55)
      at java.security.KeyStore.getKey(KeyStore.java:792)
  </code></pre>
  <p>The keystore is <em>superadmin.p12</em> converted to jks. I have also tried with other keystore created with ejbca or with keytool but i get the same error.
  Anyone know why?</p>