cURL stopped working. I started to get this error (it used work fine till few hours ago).
I am using cURL extension for PHP. I found some solution for curl command l
I know it's a bit outdated problem, but I've got a solution for others:
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
Input values :
$params = Array
(
"username" => "XXXXXXXXXX",
"password" => "XXXXXX"
);
$path ='https://www.XXXXXXXX.com/xx/xxx/format/json/';
Function:
function curlpost($parameters, $path){
$apiUrl = $path;
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $apiUrl);
curl_setopt($curl_handle, CURLOPT_BUFFERSIZE, 1024);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, TRUE);
curl_setopt($curl_handle, CURLOPT_POST, TRUE);
curl_setopt($curl_handle, CURLOPT_PROXY, '');
curl_setopt($curl_handle, CURLOPT_SSLVERSION, 4);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $parameters);
$response = curl_exec($curl_handle);
$content = curl_exec( $curl_handle );
$err = curl_errno( $curl_handle );
$errmsg = curl_error( $curl_handle );
$header = curl_getinfo( $curl_handle );
curl_close( $curl_handle );
$header['errno'] = $err;
$header['errmsg'] = $errmsg;
$header['content'] = $content;
curl_close($curl_handle);
return $header;
}
I just change from
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
to
curl_setopt($curl, CURLOPT_SSLVERSION, 4);