Reputation: 373
When i try to make payment using Paypal api it generate this error
'Curl error: SSL connect error'
- PHP version 5.4
but same code work in my local machine and i have PHP 5.6 in local machine
- is there version issue with this or somethings else ?
$curl = curl_init();
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_URL, $api_endpoint);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $nvp_string);
$result = curl_exec($curl);
if(curl_exec($curl) === false)
{
echo 'Curl error: ' . curl_error($curl);
}
else
{
echo 'Curl Execuation Success...';
}
curl_close($curl);
Upvotes: 0
Views: 11229
Reputation: 20737
You should get the actual error code with
echo curl_errno($curl); // It might display a '59'
Find '59' at https://curl.haxx.se/libcurl/c/libcurl-errors.html which is CURLE_SSL_CIPHER (59) and read about the error and then research how to fix it.
Possible fix
Based on https://stackoverflow.com/a/4073567 you should try:
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
This is potentially dangerous though, since it forces SSL3.
Upvotes: 2