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
keytool -import -alias ca -file somecert.cer -keystore cacerts –storepass changeit
when i deploy my application in windows tomcat I can communicate with HTTPS web server. However Linux tomcat gives me and error:
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)
This means it couldn't find the certifcate. The certifcate is at java security cacerts. I have used keytool -list command and it is there.
I have no idea why it works in windows and not linux. I have tried setting the paramaters in the My servlet
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");
It still doesn't work.
My questions are:
1.Anyone has any idea why this isn't working, I have tired everything?
2.How do you enbale SSL debuging for tomcat.Ss setting System.setProperty("javax.net.debug", "all") 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.
Any help is greatly appericated I am out of ideas.