Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Remote control API get sessionKey

  • MadhuraBL
  • MadhuraBL's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 9 months ago #171283 by MadhuraBL
Remote control API get sessionKey was created by MadhuraBL
How to connect to LimeSurvey RC from a different server?

I have tried the PHP Example in manual.limesurvey.org/RemoteControl_2_API#Example_and_helper in my local instance to export responses and it works perfectly fine. (limesurvey and PHP client application both in Local machine)

I have now copied the script to my PHP client application in a Test server and trying to connect to Limesurvey in a different Test server; and I am unable to get the session key from LimeSurvey.

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!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171358 by DenisChenu
Replied by DenisChenu on topic Remote control API get sessionKey
There are no difference on script.

But : your server can be unreachable by the script. Maybe your hoster disable such script for example.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • MadhuraBL
  • MadhuraBL's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 9 months ago - 5 years 9 months ago #171642 by MadhuraBL
Replied by MadhuraBL on topic Remote control API get sessionKey
Hi, Thanks for your reply.

I checked with our IT team today, they checked for proxy settings, SELinux settings, permissions, firewall and networking settings and everything seems to be fine.

I tried to execute the script from command line using curl, and I get curl error
:

curl: (60) Peer's Certificate has expired.
More details here: curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

I tried curl with -k option, and I get PHP error:


PHP Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to https://my-limesurvey-test/index.php/admin/remotecontrol' in /var/www/html/vendor/weberhofer/jsonrpcphp/src/org/jsonrpcphp/JsonRPCClient.php:155
Last edit: 5 years 9 months ago by MadhuraBL.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago - 5 years 8 months ago #171648 by DenisChenu
Replied by DenisChenu on topic Remote control API get sessionKey
Code:
$ wget https://hsu-ls-test.example.edu.au
 
…
 
--2018-07-24 08:38:32--  (essai :  7)  https://hsu-ls-test.example.edu.au/
Connexion à hsu-ls-test.imb.uq.edu.au (hsu-ls-test.imb.uq.edu.au)|130.102.116.207|:443… échec : Connexion terminée par expiration du délai d'attente.
Nouvel essai.
 
--2018-07-24 08:40:48--  (essai :  8)  https://hsu-ls-test.example.edu.au/
Connexion à hsu-ls-test.imb.uq.edu.au (hsu-ls-test.imb.uq.edu.au)|130.102.116.207|:443… échec : Connexion terminée par expiration du délai d'attente.
Nouvel essai.
Fix this before …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 8 months ago by DenisChenu.
The topic has been locked.
  • MadhuraBL
  • MadhuraBL's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 8 months ago #171698 by MadhuraBL
Replied by MadhuraBL on topic Remote control API get sessionKey
Hi, Thanks for the reply. Our test server is accessible within our company network only and so this connection time out error. I have asked my IT to renew SSL cert and hopefully after that the script will work. Will let you know.
Thanks again for the support.
And, just wondering if you can rename the links in your reply?? Thanks..
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose