Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


php -f rescript.php <appkey> <sessiontoken>

Code Snippets

Dealing with SSL in PHP

If you have errors relating to SSL certificate issues then you must do one of the following:

1) Quick fix for testing applications, should not be used in production as it may leave you exposed to man in the middle type attacks:

Add the following two lines to the sportsApingRequest function after the curl_init:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

2) Correct fix for production applications:

You will need to make use of the CURLOPT_CAINFO option, and point it to the Betfair PEM formatted certificate (which you can export from your browser). The details of exporting the cert and using this option are beyond the scope of this document but can be found elsewhere online.

Calling API-NG with JSON-RPC protocol