Certificate error while accessing EWS RRS feed

  • Question

  • Hi,

    While try to access the EWS web service, I get the following error The request failed. PKIX path building failed: unable to find valid certification path to requested target

    I have downloaded the certificate from the browser and added the certificate to the keystore of my jre. here is the snapshot of it

    keytool -import -alias -file exchange.cer -keystore cacerts -storepass changeit, May 22, 2014, trustedCertEntry,
    Certificate fingerprint (MD5): EF:3C:5D:4E:BB:EB:49:0F:8D:8D:2F:AC:A3:2C:97:52

    But, still it throws the same error. Any help is highly appreciated



    Friday, May 23, 2014 6:54 AM

All replies

  • I'm assuming that you are using the Java EWS API?  If you are using a self-signed certificate, or the certificate has an error (e.g. the name doesn't match the site), then importing it into your key store won't avoid the problem.  You need to override the certificate handling to ignore errors.

    While I can't help much with regard to Java, this blog shows how certificate handling can be overridden, and it is that technique that you'll need to adapt into your code:

    Friday, May 23, 2014 10:02 AM
  • Hello, i have a same issue.
    I want to contact exchange server 2010. I´ve created certificate, but i guess, the name is wrong.
    Which name i should use? How can i import this certificate into my java-code to avoid security-issues?

    Friday, September 9, 2016 8:16 AM
  • Hi Satyajit,

    If you are using Java EWS API, then import the proper exchange certificate (the certificate running with IIS service), and double check if self-signed certificate then the EWS URL is there in SAN list.

    There is one article you can follow, here it is well explained:

    Hope this help.



    Friday, September 9, 2016 9:57 AM