function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sukhdeep Singh 1Sukhdeep Singh 1 

I need to consume External REST API. but getting below error.

I need to consume External REST API. but getting below error.

"System.HttpRequest retrying request in response to handshake failure: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

I have password & certificate (.jks) file provided by external system team. Please let me know If I need to create me own selfsigned certificate. or I am missing something in code. Is it mandatory to set header too ?

Thanks,
pconpcon
Yes, if you have to do mutual SSL auth for this endpoint, then you will need to create / sign the certificate in Salesforce [1] [2].

[1] https://help.salesforce.com/apex/HTViewHelpDoc?id=security_keys_about.htm
[2] https://help.salesforce.com/apex/HTViewHelpDoc?id=security_keys_uploading_mutual_auth_cert.htm&language=en_US (https://help.salesforce.com/apex/HTViewHelpDoc?id=security_keys_uploading_mutual_auth_cert.htm&language=en_US)