[SalesForce] java.security.cert.CertificateException: No subject alternative names present

We are calling external system webservice from Salesforce. the webservice exposed are internet We have created stub from the WSDL. It is a SOAP based call. But while calling the service, We are getting error 'java.security.cert.CertificateException: No subject alternative names present'.

Best Answer

There are a few things that could be wrong here.

1) If you're using HTTPS for the Endpoint URL, the other system must have a CA signed SSL certificate

2) Make sure you've added the endpoint URL in the Remote Site Settings in salesforce

3) If you're using Salesforce CA signed certificate, make sure you specify the cert name in your class (example) and you upload the cert file on the other server.

EDIT: I've found some good examples for different types of integration using SSL. Hope this helps.

Making authenticated web service callouts from Salesforce

Making Authenticated Web Service Callouts Using Two-Way SSL