Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Update SSL version #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions ipnlistener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @package PHP-PayPal-IPN
* @author Micah Carrick
* @copyright (c) 2012 - Micah Carrick
* @version 2.1.0
* @version 2.1.1
*/
class IpnListener {

Expand All @@ -28,7 +28,7 @@ class IpnListener {
*
* @var boolean
*/
public $force_ssl_v3 = true;
public $force_ssl_v3 = false;

/**
* If true, cURL will use the CURLOPT_FOLLOWLOCATION to follow any
Expand Down Expand Up @@ -93,19 +93,22 @@ protected function curlPost($encoded_data) {

$ch = curl_init();

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO,
dirname(__FILE__)."/cert/api_cert_chain.crt");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO,
dirname(__FILE__)."/cert/api_cert_chain.crt");
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_data);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $this->follow_location);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_SSLVERSION, 1);

if ($this->force_ssl_v3) {
// You should know that Paypal does not recommand using this version
// https://github.com/paypal/rest-api-sdk-php/commit/8e193664151578a0eeeca1129c9f3203951ac15a
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
}

Expand Down