Skip to content

Commit b78fb0c

Browse files
committed
MAGETWO-61531: Paypal SSL Curl communication error, TLS 1.2 required for https://*.paypal.com
- moving default value into constructor and removing private method
1 parent 4463e0d commit b78fb0c

File tree

1 file changed

+2
-17
lines changed
  • lib/internal/Magento/Framework/HTTP/Client

1 file changed

+2
-17
lines changed

lib/internal/Magento/Framework/HTTP/Client/Curl.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function setTimeout($value)
122122
/**
123123
* @param int|null $sslVersion
124124
*/
125-
public function __construct($sslVersion = null)
125+
public function __construct($sslVersion = self::SSL_VERSION)
126126
{
127127
$this->sslVersion = $sslVersion;
128128
}
@@ -383,7 +383,7 @@ protected function makeRequest($method, $uri, $params = [])
383383

384384
$this->curlOption(CURLOPT_RETURNTRANSFER, 1);
385385
$this->curlOption(CURLOPT_HEADERFUNCTION, [$this, 'parseHeaders']);
386-
$this->setSSLVersion($this->sslVersion);
386+
$this->curlOption(CURLOPT_SSLVERSION, $this->sslVersion);
387387

388388
if (count($this->_curlUserOptions)) {
389389
foreach ($this->_curlUserOptions as $k => $v) {
@@ -496,19 +496,4 @@ public function setOption($name, $value)
496496
{
497497
$this->_curlUserOptions[$name] = $value;
498498
}
499-
500-
/**
501-
* Set ssl version to specified version or default
502-
*
503-
* @param int $sslVersion
504-
* @return void
505-
*/
506-
private function setSSLVersion($sslVersion)
507-
{
508-
if ($sslVersion) {
509-
$this->sslVersion = $sslVersion;
510-
} else {
511-
$this->sslVersion = self::SSL_VERSION;
512-
}
513-
}
514499
}

0 commit comments

Comments
 (0)