Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Added optional function to turn off SSL verification (on by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuntu committed Nov 13, 2015
1 parent 941f786 commit 5ae9341
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions classes/RightSignature/HttpClient.php
Expand Up @@ -11,15 +11,9 @@
*/
class HttpClient implements HttpClientInterface
{
/**
* @var ClientInterface
*/
private $_client;

/**
* @var api token
*/
private $_apiToken;
private $_verifySSL = true;

/**
* @param The $apiToken
Expand Down Expand Up @@ -47,6 +41,13 @@ private function __construct(ClientInterface $client)
$this->_client = $client;
}

/**
* @param $bool
*/
public function setVerifySSL($bool) {
$this->_verifySSL = (bool) $bool;
}

/**
* @param string $path
* @return string
Expand All @@ -60,7 +61,7 @@ public function get($path)
'Api-Token' => $this->_apiToken,
'Api-Version' => \RightSignature::API_VERSION
],
'verify' => false
'verify' => $this->_verifySSL
]
];

Expand All @@ -81,7 +82,7 @@ public function post($path, $body=null)
'Api-Token' => $this->_apiToken,
'Api-Version' => \RightSignature::API_VERSION
],
'verify' => false
'verify' => $this->_verifySSL
]
];

Expand Down

0 comments on commit 5ae9341

Please sign in to comment.