Skip to content

Commit

Permalink
Added option to disable curl ssl verification
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfensdrfer committed Jan 3, 2019
1 parent 68872c2 commit d4a163c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/AutoUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ class AutoUpdate
*/
private $onAllUpdateFinishCallbacks = [];

/**
* If curl should verify the host certificate.
*
* @var bool
*/
private $sslVerifyHost = true;

/**
* Url to the update folder on the server.
*
Expand Down Expand Up @@ -404,6 +411,24 @@ public function getSimulationResults()
return $this->simulationResults;
}

/**
* @return bool
*/
public function getSslVerifyHost()
{
return $this->sslVerifyHost;
}

/**
* @param bool $sslVerifyHost
*/
public function setSslVerifyHost($sslVerifyHost)
{
$this->sslVerifyHost = $sslVerifyHost;

return $this;
}

/**
* Check for a new version
*
Expand Down Expand Up @@ -562,6 +587,8 @@ protected function _downloadCurl($url)
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, $this->sslVerifyHost);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->sslVerifyHost);
$update = curl_exec($curl);

$error = false;
Expand Down

0 comments on commit d4a163c

Please sign in to comment.