From b78fb0ca208e81b8294b5b1b8b546cae5c027485 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Mon, 28 Nov 2016 13:28:27 -0600 Subject: [PATCH] MAGETWO-61531: Paypal SSL Curl communication error, TLS 1.2 required for https://*.paypal.com - moving default value into constructor and removing private method --- .../Magento/Framework/HTTP/Client/Curl.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/internal/Magento/Framework/HTTP/Client/Curl.php b/lib/internal/Magento/Framework/HTTP/Client/Curl.php index 136f9924933..5ebc92abf70 100644 --- a/lib/internal/Magento/Framework/HTTP/Client/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Client/Curl.php @@ -122,7 +122,7 @@ class Curl implements \Magento\Framework\HTTP\ClientInterface /** * @param int|null $sslVersion */ - public function __construct($sslVersion = null) + public function __construct($sslVersion = self::SSL_VERSION) { $this->sslVersion = $sslVersion; } @@ -383,7 +383,7 @@ class Curl implements \Magento\Framework\HTTP\ClientInterface $this->curlOption(CURLOPT_RETURNTRANSFER, 1); $this->curlOption(CURLOPT_HEADERFUNCTION, [$this, 'parseHeaders']); - $this->setSSLVersion($this->sslVersion); + $this->curlOption(CURLOPT_SSLVERSION, $this->sslVersion); if (count($this->_curlUserOptions)) { foreach ($this->_curlUserOptions as $k => $v) { @@ -496,19 +496,4 @@ class Curl implements \Magento\Framework\HTTP\ClientInterface { $this->_curlUserOptions[$name] = $value; } - - /** - * Set ssl version to specified version or default - * - * @param int $sslVersion - * @return void - */ - private function setSSLVersion($sslVersion) - { - if ($sslVersion) { - $this->sslVersion = $sslVersion; - } else { - $this->sslVersion = self::SSL_VERSION; - } - } } -- GitLab