PHP cURL returns FALSE on HTTPS

You can prevent cURL from trying to verify the SSL certificate by using CURLOPT_VERIFYPEER.

Also set the action in the URL:

$ch = curl_init();
$data = array('user' => 'xxx', 'password' => 'yyy');
curl_setopt($ch, CURLOPT_URL, 'https://coinroll.it/getbalance');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
echo $result;

You can use the following cURL option in order to see what happens with the HTTP connection:

curl_setopt($ch, CURLOPT_VERBOSE, true);

When TRUE it outputs verbose information.

Tags:

Php

Curl

Post