4

Error message :PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target HTTPS server Certificate Issuer is "COMODO RSA Domain Validation Secure Server CA" with Signature hash algorithm Name "Sha256".

Here is the sample code

HttpRequest req = new HttpRequest();
req.setEndpoint(<HTTPS server>);
req.setMethod('POST');
req.setHeader('Content-type','application/json');
HTTPResponse res = http.send(req);
System.debug(res.getBody());
  • 2
    Check if your endpoint has valid SSL certificate(f.e. ssllabs.com), if no -- ask endpoint owner to improve it. If that's not possible--middleware proxy is your solution – kurunve Jan 23 '18 at 9:17
4

Recently ran into this issue myself.

The problem in my case was that the SSL certificate on the server I was calling out to was not installed correctly.

As I understand, most SSL cert providers issue certificates to their customers using "Intermediate" certificates (which are signed by a "Root" certificate held by the issuing company).

Browsers (and Salesforce) trust the root certificates, so to have Salesforce trust the certificate that you were issued, your certificate needs to include the entire chain of certificates back up to one of the trusted root certificates (e.g. your cert -> intermediate cert -> root cert).

When the certificate chain is broken, you get this error.

Fixing SSL certs on external servers is beyond the scope of this site (and a bit beyond my personal knowledge).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.