+ Start a Discussion
Zabi MohammedZabi Mohammed 

REST API callout from salesforce

i am getting the following error when i was try to call external server from salesforce, this error is getting becatuse of Https call out.
any one can help on this error.
"System.CalloutException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

Ajay K DubediAjay K Dubedi

 There are two things to check,
1. check to make sure you have imported your certificate to your java keystore.
2. check to make sure you have all your certificate bundle files installed in your apache webserver.
there is a java class "SSLPoke.class" which you can download here:
(class) http://confluence.atlassian.com/download/attachments/180292346/SSLPoke.class?version=1&modificationDate=1236556489366 (http://confluence.atlassian.com/download/attachments/180292346/SSLPoke.class?version=1&modificationDate=1236556489366)
(src)    http://confluence.atlassian.com/download/attachments/180292346/SSLPoke.java?version=1&modificationDate=1236556497004 (http://confluence.atlassian.com/download/attachments/180292346/SSLPoke.java?version=1&modificationDate=1236556497004)
and here's how to use it:
java SSLPoke localhost 443<br>
It simply connects to a SSL service, sends a byte of input, and watches the output. For instance, connecting to a local HTTPS server on port 443 (the HTTPS default) with a untrusted (self-signed) certificate.
if you get "successfully connected" then you are good, otherwise you need to check the above items I mentioned.
for more information please see the link below: