Skip to content

Commit

Permalink
Issue MicahCarrick#3 - Added force_ssl_v3 parameter for cURL using Gn…
Browse files Browse the repository at this point in the history
…uTLS.
  • Loading branch information
Micah Carrick committed Sep 17, 2011
1 parent 2bd6277 commit c031d72
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ipnlistener.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ class IpnListener {
*/
public $use_curl = true;

/**
* If true, explicitly sets cURL to use SSL version 3. Use this if cURL
* is compiled with GnuTLS SSL.
*
* @var boolean
*/
public $force_ssl_v3 = false;

/**
* If true, an SSL secure connection (port 443) is used for the post back
* as recommended by PayPal. If false, a standard HTTP (port 80) connection
Expand Down Expand Up @@ -86,6 +94,10 @@ protected function curlPost($encoded_data) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);

if ($this->force_ssl_v3) {
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
}

$this->response = curl_exec($ch);
$this->response_status = strval(curl_getinfo($ch, CURLINFO_HTTP_CODE));

Expand Down

0 comments on commit c031d72

Please sign in to comment.