How to use certificate when making Salesforce Apex Callouts?

How to use certificate when making Salesforce Apex Callouts?

setClientCertificateName() can be used to assign certificate when making Salesforce Apex Callouts.

Sample Certificate:

Sample Code:

HttpRequest req = new HttpRequest();
req.setClientCertificateName( 'Test_Certificate' );
req.setMethod ( 'GET' );
System.debug(
    'Request is ' +
    req
);

So, when doing Apex Callouts, use setClientCertificateName() method to assign the certificate.

Leave a Reply