function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gaurav.dixitgaurav.dixit HTTP and HTTPS Callout with SSL encryption?

We have to make a secure callout to a HTTPS endpoint ( for completing payment process.  The expectation is that the request should be encrypted when sending to the Payment gateway service. provides a class (Crypto class) to encrypt the requests.  However this requires a private key to be used for encrypting the data. 


  it seems that does not provide a private key but provides only a certificate (public key).  When using this public key for encryption, returns an error that this is not a valid private key. Does anyone know 


  1. If making a HTTP connection to a HTTPS endpoint, if the request is encrypted by default and that no other additional encryption is needed?
  2. How to make an encrypted call to payment gateway service (HTTPS endpoint)?



An HttpRequest from APEX to an https endpoint is secure and runs over SSL.   Bear in mind that the host you connect to must have a valid SSL cert, that has not expired, and the hostname matches what is embedded in the cert or it will not connect.


Good luck, 


Dan Smith



Atif MohammedAtif Mohammed



Is there any tool kit of integrating with salesforce.