Skip to content

Commit

Permalink
SSL version setter added (close #102)
Browse files Browse the repository at this point in the history
  • Loading branch information
stas17 authored and baibaratsky committed Sep 2, 2016
1 parent b42913f commit ae07786
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Request/Requester/CurlRequester.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@

class CurlRequester extends AbstractRequester
{

/**
* default ssl version
* @var int
*/
private $sslVersion = 1;

/**
* @param int $sslVersion
*/
public function setSSLVersion($sslVersion)
{
$this->sslVersion = $sslVersion;
}

/**
* @param AbstractRequest $request
*
Expand All @@ -32,7 +47,7 @@ protected function request(AbstractRequest $request)
curl_setopt($handler, CURLOPT_CAINFO, dirname(dirname(__DIR__)) . '/WMUsedRootCAs.cer');
}
curl_setopt($handler, CURLOPT_SSL_VERIFYPEER, $this->verifyCertificate);
curl_setopt($handler, CURLOPT_SSLVERSION, 1);
curl_setopt($handler, CURLOPT_SSLVERSION, $this->sslVersion);

if (($request instanceof XRequest && $request->getAuthType() === XRequest::AUTH_LIGHT)
|| ($request instanceof ATMRequest && $request->getAuthType() === ATMRequest::AUTH_LIGHT)
Expand Down

0 comments on commit ae07786

Please sign in to comment.