[SalesForce] java.security.cert.CertificateException: No name matching

I am getting this error in rest apex callout: java.security.cert.CertificateException: No name matching da1.camso.co found.

Not sure why I am getting this any certificate I have to or they to add from server side

> HttpRequest req = new HttpRequest();   
> req.setEndpoint('https://da1.camso.co:50001/RESTAdapter/sold_to/refresh');
> req.setMethod('GET'); String username = '***'; String password = '**';
> Blob headerValue = Blob.valueOf(username + ':' + password); String
> authorizationHeader = 'BASIC ' +
> EncodingUtil.base64Encode(headerValue); req.setHeader('Authorization',
> authorizationHeader);  Http http = new Http(); HTTPResponse res =
> http.send(req); System.debug(res.getBody());

I guess this is certificate issue…What are the steps I have follow from salesforce side?? Do I need to download self-signed certificate and give it to client??

Best Answer

Looks like your endpoint server has no valid certificate. Consider checking in browser. enter image description here

Make sure that you are using valid certificate.