To solve this problem you can try the following
Download SSLPoke.java from Google
SSLPoke.java
Compile it:
javac SSLPoke.java
Once you compile the SSLPoke code call as
java -Djavax.net.debug=all SSLPoke [your https host] 443
In the output, you will see where java is looking for cacerts.
Once you know the exact location, use keytool to import your file into cacerts
keytool -import -alias [your https host] -keystore [the location returned]/cacerts -file [your.crt]
And that’s it, restart tomcat and it should work correctly.
Several times when you have many versions of java on the same Linux machine, even adding [your.crt] to cacerts returned by debug does not work, if so, add [your.crt] to all cacerts on Linux you can find everything:
locate cacert
as soon as the Linux machine returns all cacerts locations, for example:
/home/xuser/NetBeansProjects/porjectx/conf/cacerts /opt/otherlocation/j2sdkee1.3.1/lib/security/cacerts.jks /opt/icedtea-bin-6.1.12.7/jre/lib/security/cacerts /opt/icedtea-bin-6.1.13.5/jre/lib/security/cacerts /opt/icedtea-bin-7.2.4.1/jre/lib/security/cacerts /opt/oracle-jdk-bin-1.7.0.76/jre/lib/security/cacerts /opt/sun-j2ee-1.3.1/lib/security/cacerts.jks
add [your.crt] to all of them with keytool and restart tomcat.
If you do not have your.crt file, you can get it with the command
openssl s_client -connect [your https host]:443 < /dev/null
and copy from ----- BEGIN CERTIFICATE ----- ----- END OF CERTIFICATE -----
I hope this helps you