LimeSurvey RemoteControl JSON_RPC API from Drupal Has anyone used LimeSurvey's RemoteControl JSON_RPC API PHP script from Drupal to connect to LimeSurvey in a different server?

I have tried the PHP Example in https://manual.limesurvey.org/RemoteControl_2_API#Example_and_helper in my local instance to export a survey responses and it works perfectly fine. 

I have now copied the script to my Drupal folder (installed library jsonrpcphp through composer) in a Test server and trying to connect to Limesurvey in a different Test server; and I am unable to get the connection right.

I have updated the filename, base URLs, username and passwords for the Test instances. Not sure If it is something to do with "https" in the URL? URL for Local instance was "http". Because the script breaks at get_session_key line.

Any help with this will be appreciated! Please drop a comment if more info is required.
SSL certificate in the Lime Survey test server was expired. Renewed the SSL cert.