Skip to content

Commit

Permalink
Merge pull request #11 from bahuma20/master
Browse files Browse the repository at this point in the history
Add option to disable SSL Peer verification to Client.
  • Loading branch information
ilijastuden authored May 10, 2017
2 parents 63401d4 + 0c6a58a commit 2663048
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
26 changes: 25 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function getApiVersion()
public function &getConnector()
{
if (empty($this->connector)) {
$this->connector = new Connector();
$this->connector = (new Connector())->setSslVerifyPeer($this->getSslVerifyPeer());
}

return $this->connector;
Expand Down Expand Up @@ -226,4 +226,28 @@ private function prepareAttachments($attachments = null)

return $file_params;
}


/**
* @var bool
*/
private $ssl_verify_peer = true;

/**
* {@inheritdoc}
*/
public function getSslVerifyPeer()
{
return $this->ssl_verify_peer;
}

/**
* {@inheritdoc}
*/
public function &setSslVerifyPeer($value)
{
$this->ssl_verify_peer = (bool) $value;

return $this;
}
}
2 changes: 1 addition & 1 deletion src/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* @package ActiveCollab\SDK
*/
interface ClientInterface
interface ClientInterface extends VerifySslPeerInterface
{
const VERSION = '3.0.0';

Expand Down

0 comments on commit 2663048

Please sign in to comment.