forked from LiveCarta/PayPal-PHP-SDK
Fixed Curl Options for NSS
This commit is contained in:
@@ -12,7 +12,7 @@ class PPConstants
|
||||
{
|
||||
|
||||
const SDK_NAME = 'PayPal-PHP-SDK';
|
||||
const SDK_VERSION = '0.14.1';
|
||||
const SDK_VERSION = '0.14.2';
|
||||
|
||||
const REST_SANDBOX_ENDPOINT = "https://api.sandbox.paypal.com/";
|
||||
const OPENID_REDIRECT_SANDBOX_URL = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect";
|
||||
|
||||
@@ -32,7 +32,6 @@ class PPHttpConfig
|
||||
//Adding it like this for backward compatibility with older versions of curl
|
||||
);
|
||||
|
||||
|
||||
const HEADER_SEPARATOR = ';';
|
||||
const HTTP_GET = 'GET';
|
||||
const HTTP_POST = 'POST';
|
||||
@@ -61,6 +60,13 @@ class PPHttpConfig
|
||||
$this->url = $url;
|
||||
$this->method = $method;
|
||||
$this->curlOptions = self::$defaultCurlOptions;
|
||||
// Update the Cipher List based on OpenSSL or NSS settings
|
||||
$curl = curl_version();
|
||||
$sslVersion = isset($curl['ssl_version']) ? $curl['ssl_version'] : '';
|
||||
if (substr_compare($sslVersion, "NSS/", 0, strlen("NSS/")) === 0) {
|
||||
//Remove the Cipher List for NSS
|
||||
$this->removeCurlOption(CURLOPT_SSL_CIPHER_LIST);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,13 +173,23 @@ class PPHttpConfig
|
||||
* Add Curl Option
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function addCurlOption($name, $value)
|
||||
{
|
||||
$this->curlOptions[$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a curl option from the list
|
||||
*
|
||||
* @param $name
|
||||
*/
|
||||
public function removeCurlOption($name)
|
||||
{
|
||||
unset($this->curlOptions[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Curl Options. Overrides all curl options
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user