I am trying to connect to a mail server and read my inbox. My code works for gmail but does not seem to work with my exchange server because of the error:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
I have tried the following as per my research: 1. downloaded the InstallCert.java and ran the folllowing command:
java InstallCert mail.simbatech.biz:993
and imported the one certificate that came in, I afterwards copied the jssecacerts
file to jre/lib/security directory of my java Installation but the same error still persists. Is there Any other way to do this?
It sounds like you're doing the right things, but apparently your application is not using the certificate file you created. Where is your application running? If it's running in an application server, the server may be overriding the trust store configuration and may thus be ignoring your jssecacerts file. Try enabling additional debug output as described in the JavaMail FAQ.