Yet another Paypal Curl / SSL v3 Handshake Error -

2019-08-09 09:23发布

问题:

I know there are a number of people asking this question, but none of the solutions I've read to date have worked for me.

A site with a Paypal IPN listener fails in the curl postback. Curl Error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

My curl options look as follows:

curl_setopt($ch, CURLOPT_URL, 'https://www.sandbox.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.sandbox.paypal.com'));
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1); 
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'TLSv1');

My curl version is 7.29.0. This is on a lighttpd based server.

I have a feeling this is because curl is not "accepting" my attempts to force tls, but I'm unsure how to rectify.

回答1:

Updating my distribution and thus OpenSSL did solve the problem.