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
Roberto ArconadaRoberto Arconada 

Error doing callout to a site with GoDaddy certificate


2down votefavorite
1

When we try to send some data to an external web service (REST, POST, JSON), we get the next 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

If we check the certificate, it's a valid "Go Daddy Secure Certificate Authority - G2".

Also, We have checked that this company is included as a valid Certificate Authority into Salesforce list (https://developer.salesforce.com/page/Outbound_Messaging_SSL_CA_Certificates#godaddy).
Best Answer chosen by Roberto Arconada
SonamSonam (Salesforce Developers) 
Posting the answer here so that it can help users facing similar error:
Go to https://www.digicert.com/help/ 
put the <end point URL> and click on check server: 

You will get the error below: 
SSL Certificate is not trusted 

The certificate is not signed by a trusted authority (checking against Mozilla's root store). If you bought the certificate from a trusted authority, you probably just need to install one or more Intermediate certificates. Contact your certificate provider for assistance doing this for your server platform. 

I understand you have used Go Daddy to sign the certificate, however, following is the only ones Salesforce supports By Godaddy: 

godaddy 
godaddyclass2ca 
godaddyint 

Kindly check to see the certificate Godaddy has provided - you can show them the 3 given above and ask them to confirm if the certificate given to you is one of them, if not - you need to get one with is salesforce supported.

Do post if you have done any additonal troubleshooting.