As per documentation and SSL handshake process, three callouts needs to be made for secured connection. One is for getting digital certificate, second for creating a session key and third one for actual data transfer. But Salesforce consumes only one callout. Is Salesforce becoming more graceful and counting only one callout instead of three. Or is my understanding about whole SSL process is wrong. I want to understand whether those steps are getting performed or not.
-
where do you get that only one callout can be made?? You can make as many as needed as long as the total time spent is less than 2 mins and no dml is performed in between– EricCommented Nov 15, 2015 at 6:21
-
Hi Eric, thanks for reply. Here I am not worried about how many callouts I would be able to make. I want to know what's happening behind the scene in the platform. I can see one callout in debug logs whenever I try to access HTTPS service.– Kiran MachhewarCommented Nov 15, 2015 at 7:28
-
Just for clarification - "just as many" should read up to 100– EricCommented Nov 15, 2015 at 15:04
-
Yes Eric. But here I want to understand SSL handshake process in Salesforce. Sfdcfox has clarified it a bit for me. But still I haven't understood what's going behind the sxenes.– Kiran MachhewarCommented Nov 15, 2015 at 16:08
1 Answer
SSL has multiple steps, from the initial handshake to the final process of transferring data through a secured, synchronously encrypted communication channel. However, only one socket is used. There are many packets transferred, but only one socket is used. Salesforce considers a single call to Http.send() as a single callout, even though there's a handshake and other steps involved. All of this is abstracted away from the developer. Salesforce has always counted one call to Http.send() as a single transaction, even though there's several steps involved in SSL handshakes.
-
Hi sfdcfox, thanks for answering. Here as per your explanation packets are getting transfered to and fro which means its maintining a state with the server with which Salesforce is talking to. As far I understand every call is a stateless so it should have consumed three calls. Socket concept is understandable but now its confusing with stateless protocol. Is there any documentation giving difference between stateless http and socket connection. Thanks again for your reply at least I got something to dig upon. Any comments would be very helpful for me. Commented Nov 15, 2015 at 11:09