• Kalyan Erraguntla 5
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have to callout webservice in the external server. I got the certificate from them along with password but no username. 

Its SOAP API implementataion, but we have issues with wsdl file so i am unable to generate the apex classes out of wsdl file. As an alternate approach, we have picked up the restful webservices implementation to send the SOAP requests using HTTP classes.

We have converted the .pfx format to .jks format and imported to salesforce using the keystore password.

The question now is, how to set the certificate along with password with HTTP callout? I have read that setCertificateName can be used. But i have doubt on whether this works or not? If it works, how to attach the password along with certificate name to HTTP callout?
I am trying to invoke 3rd party web-services from Salesforce using WSDL2APEX. The client has also shared a .p12 certificate which I need to use for client authentication while making web-service call from Salesforce along with username and password.

I converted above .pfx into base64 using openSSL and tried below:
stub.clientCert_x = 'base64encodedstring'; 
stub.clientCertPasswd_x = 'password used for importing .pfx (password used for protecting private key)'


I am not sure above password is same as keystore password. But this method is not working.

I converted .p12(.pfx) into .jks and imported the same in Salesforce and used below:
 
​stub.clientCertName_x = 'CertificateUniqueName';



Even above method didn't work. Tried the same with HTTP callouts, but no luck.

I am not sure where I am going wrong. I am getting response from the server that authentication certificate is missing, hence I believe that the callout is successful.

My client has used "GlobalSign Root CA" which is supported by Salesforce.

Please let me know if my approach is wrong. Should I first export .p12 into public and private keys and then use it ?