diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a0a6845..c9fc7579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ # Changelog ## master -[v6.0.1...master](https://github.com/deployphp/deployer/compare/v6.0.1...master) +[v6.0.2...master](https://github.com/deployphp/deployer/compare/v6.0.2...master) +🍰 + +## v6.0.2 +[v6.0.1...v6.0.2](https://github.com/deployphp/deployer/compare/v6.0.1...v6.0.2) + +### Fixed +- Fixed bug with curl ssh check in _Httpie_ util ## v6.0.1 [v6.0.0...v6.0.1](https://github.com/deployphp/deployer/compare/v6.0.0...v6.0.1) diff --git a/KNOWN_BUGS.md b/KNOWN_BUGS.md index a7206297..31083801 100644 --- a/KNOWN_BUGS.md +++ b/KNOWN_BUGS.md @@ -17,3 +17,10 @@ ControlPersist causes stderr to be left open until the master connection times o * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714526 * https://bugzilla.mindrot.org/show_bug.cgi?id=1988 + + +## cURL 7.29.0 + +Certificate verification fails with multiple https urls. + +* https://bugzilla.redhat.com/show_bug.cgi?id=1241172 diff --git a/src/Utility/Httpie.php b/src/Utility/Httpie.php index 91466a01..6a34146c 100644 --- a/src/Utility/Httpie.php +++ b/src/Utility/Httpie.php @@ -13,6 +13,7 @@ class Httpie private $url = ''; private $headers = []; private $body = ''; + private $curlopts = []; public function __construct() { @@ -76,6 +77,13 @@ class Httpie return $http; } + public function setopt($key, $value) + { + $http = clone $this; + $http->curlopts[$key] = $value; + return $http; + } + public function send() { $ch = curl_init($this->url); @@ -87,6 +95,9 @@ class Httpie curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, CURLOPT_TIMEOUT, 5); + foreach ($this->curlopts as $key => $value) { + curl_setopt($ch, $key, $value); + } $result = curl_exec($ch); curl_close($ch); return $result; diff --git a/src/Utility/Reporter.php b/src/Utility/Reporter.php index b8403868..f5e4f565 100644 --- a/src/Utility/Reporter.php +++ b/src/Utility/Reporter.php @@ -14,9 +14,6 @@ class Reporter { const ENDPOINT = 'https://deployer.org/api/stats'; - /** - * @param array $stats - */ public static function report(array $stats) { $pid = null; @@ -28,7 +25,7 @@ class Reporter if (is_null($pid) || $pid === -1) { // Fork fails or there is no `pcntl` extension. try { - Httpie::post(self::ENDPOINT)->body($stats)->send(); + self::send($stats); } catch (\Throwable $e) { // pass } @@ -36,7 +33,7 @@ class Reporter // Child process. posix_setsid(); try { - Httpie::post(self::ENDPOINT)->body($stats)->send(); + self::send($stats); } catch (\Throwable $e) { // pass } @@ -44,4 +41,12 @@ class Reporter exit(0); } } + + private static function send(array $stats) + { + Httpie::post(self::ENDPOINT) + ->body($stats) + ->setopt(CURLOPT_SSL_VERIFYPEER, false) + ->send(); + } }