Paypal ssl handshake faliure

Hi, I am using the Paypal PHP SDK to communicate with Paypal Api.

2 days before everything worked fine. But now I get this error on my development servers.

error: 14094410: SSL routines: SSL3_READ_BYTES: sslv3 communication rejection

I use the following CURL options when prompted:

public static $DEFAULT_CURL_OPTS = array( CURLOPT_SSLVERSION => 1, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute CURLOPT_USERAGENT => 'PayPal-PHP-SDK', CURLOPT_HTTPHEADER => array(), CURLOPT_SSL_VERIFYHOST => 2, CURLOPT_SSL_VERIFYPEER => 1, CURLOPT_SSL_CIPHER_LIST => 'TLSv1', ); 

This problem only occurs when using SANDBOX mode in real time. Everything is working fine.

Does any body know why this is happening?

thanks

+7
paypal paypal-sandbox paypal-ipn
source share
1 answer

I experienced the same error. This is due to recent updates that PayPal made: https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1766

You can fix this by adding this to your CURL options:

curl_setopt($ch, CURLOPT_SSLVERSION , 1);

or

CURLOPT_SSL_SSLVERSION => 1

EDIT: Full working settings

 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_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); curl_setopt($ch, CURLOPT_SSLVERSION , 1); 
+3
source share

All Articles