I want to know the process of authorization or authentication using self-signed certificates.
I am trying to integrate two salesforce dev orgs using REST callouts. I have created a self-signed certificate (named: 'TestCertificate') under certificate and key management section, exported it to keystore (.jks file generated) in one org say 'Org A' and imported the same .jks file in another org say 'Org B'.
Now i am trying to callout from org A to org B using http. below is the code snippet:
HttpRequest httpReq = new HttpRequest();
httpReq.setMethod('GET');
httpReq.setEndpoint('https://login.salesforce.com/services/data/v43.0/sobjects/account/describe');
httpReq.setClientCertificateName('TestCertificate');
Http http = new Http();
HttpResponse response = http.send(httpReq);
(I have used my dev org domain name instead of login.salesforce.com). In response i am getting 401, Unauthorized error.
Could someone help with the process of authorization with certificates? is there any other details needs to be passed in the header? or How does certificates authorization works?
httpReq.setClientCertificateName('TestCertificate');
and try