I'm using WebServiceCallout.invoke in an Apex class to call an external SOAP web service (namely the SOAP API for Central Desktop).
Unfortunately, the external service has an invalid SSL certificate for its API endpoint, so I'm getting the following error:
System.CalloutException: IO Exception: java.security.cert.CertificateException:
No subject alternative DNS name matching accountname.api.centraldesktop.com found.
The problem is basically that the external service has a wildcard certificate for *.centraldesktop.com but the certificate is not valid for *.api.centraldesktop.com. Therefore, the API endpoint causes this error.
Ideally the external service can fix its SSL certificate, but barring that option, I'm looking for a work-around in Salesforce. Is there a way to ignore the certificate error when using WebServiceCallout.invoke in Salesforce?