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
Akshat Agrawal SFCAkshat Agrawal SFC 

Salesforce callout : unable to find valid certification path, but from POSTMAN it's working

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());
Davide Fabris 16Davide Fabris 16
Usually it measn the server is not exposing the full certification path explicitly.
POSTMAN does not enforce this check. This (https://developer.salesforce.com/forums/?id=906F00000008lzhIAA)may help