Skip to content

Commit

Permalink
Remove SSL version 3 support.
Browse files Browse the repository at this point in the history
This commit mirrors Hopu-Ka-Lewa-website commit de82f186ceaf003df3460aa88cae18f361447686.

Per the original IPN listener author's repo pull request 32: [MicahCarrick/PHP-PayPal-IPN#32](MicahCarrick/PHP-PayPal-IPN#32).
(This pull request had not yet been pulled into the original repo at the time of this edit.)

PayPal has stopped supporting SSLv3, so we have to as well.
  • Loading branch information
kcmckell committed Nov 19, 2014
1 parent 317c386 commit 414f6c4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions control/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

0 comments on commit 414f6c4

Please sign in to comment.