Posted by: Chyne on: June 5, 2009
How do you know whether the SSL certificate has been imported successfully and whether the failure of mail server is related to the problem of SSL certificate?
I guessed the following errors are obvious to tell you that the mail server is unable to find the certification path for the request:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:441)
at javax.mail.Service.connect(Service.java:233)
at javax.mail.Service.connect(Service.java:134)
In order to have the further confirmation that you had obtained and imported the server’s public key successfully, you can try the following steps to troubleshoot the problem:
• You can run the ‘‘ps -ef | grep java’ to check whether the java process is running with the following option:-
-Djavax.net.ssl.trustStore=/path/to/keystore.
• You can view the keystore by issuing the command ‘keystore -list‘
To fix the problem of SSL certificate not being imported properly, you can try the following workaround:
• Run the command ‘java InstallCert hostname’ to generate a file with the SSL certificate.
• Copy the ./ jssecacerts to $JAVA_HOME/jre/lib/security.
There is an interesting blog regarding with this issue that discussed about the causes and also the detailed solution of the problem. The blog also attached with the InstallCert program that enables you to download to compile and run the program to generate the certificate: http://blogs.sun.com/andreas/entry/no_more_unable_to_find