title: need help Debugging SSL handshake in tomcat
body: <p>I have a very weird issue and looking for some tips. I have a certificate sent by client that I need to install so I can access HTTPS webservice. The certifcate has been installed, in both windows and Linux OS. using keytool command</p>
  
  <pre><code>keytool -import -alias ca -file somecert.cer -keystore cacerts –storepass changeit
  </code></pre>
  
  <p>when i deploy my application in windows tomcat I can communicate with HTTPS web server. However Linux tomcat gives me and error:</p>
  
  <blockquote>
    <p>Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
    unable to find valid certification path to requested target   at
    sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:236)
      at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)
      at
    sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)</p>
  </blockquote>
  
  <p>This means it couldn't find the certifcate. The certifcate is at java security cacerts. I have used <code>keytool -list</code> command and it is there.</p>
  
  <p>I have no idea why it works in windows and not linux. I have tried setting the paramaters in the My servlet</p>
  
  <pre><code>System.setProperty("javax.net.debug", "all"); 
  System.setProperty("javax.net.ssl.trustStore", "/usr/java/jdk1.5.0_14/jre/lib/security/cacerts"); 
  System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); 
  </code></pre>
  
  <p>It still doesn't work.</p>
  
  <p>My questions are:</p>
  
  <p>1.Anyone has any idea why this isn't working, I have tired everything?</p>
  
  <p>2.How do you enbale SSL debuging for tomcat.Ss setting <code>System.setProperty("javax.net.debug", "all")</code> works ? For some reason I don't see any SSL debug Info in Catalina.out. Do I need to change anything else.What kind of debug info should i see.</p>
  
  <p>Any help is greatly appericated I am out of ideas.</p>