mirror of
https://github.com/deployphp/deployer.git
synced 2025-01-17 21:48:58 +01:00
Fix bug with curl ssl verify peer
This commit is contained in:
parent
386b91ba46
commit
818dbdb7f2
@ -1,8 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## master
|
## 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.1
|
||||||
[v6.0.0...v6.0.1](https://github.com/deployphp/deployer/compare/v6.0.0...v6.0.1)
|
[v6.0.0...v6.0.1](https://github.com/deployphp/deployer/compare/v6.0.0...v6.0.1)
|
||||||
|
@ -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://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714526
|
||||||
* https://bugzilla.mindrot.org/show_bug.cgi?id=1988
|
* 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
|
||||||
|
@ -13,6 +13,7 @@ class Httpie
|
|||||||
private $url = '';
|
private $url = '';
|
||||||
private $headers = [];
|
private $headers = [];
|
||||||
private $body = '';
|
private $body = '';
|
||||||
|
private $curlopts = [];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -76,6 +77,13 @@ class Httpie
|
|||||||
return $http;
|
return $http;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setopt($key, $value)
|
||||||
|
{
|
||||||
|
$http = clone $this;
|
||||||
|
$http->curlopts[$key] = $value;
|
||||||
|
return $http;
|
||||||
|
}
|
||||||
|
|
||||||
public function send()
|
public function send()
|
||||||
{
|
{
|
||||||
$ch = curl_init($this->url);
|
$ch = curl_init($this->url);
|
||||||
@ -87,6 +95,9 @@ class Httpie
|
|||||||
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
||||||
|
foreach ($this->curlopts as $key => $value) {
|
||||||
|
curl_setopt($ch, $key, $value);
|
||||||
|
}
|
||||||
$result = curl_exec($ch);
|
$result = curl_exec($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
return $result;
|
return $result;
|
||||||
|
@ -14,9 +14,6 @@ class Reporter
|
|||||||
{
|
{
|
||||||
const ENDPOINT = 'https://deployer.org/api/stats';
|
const ENDPOINT = 'https://deployer.org/api/stats';
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $stats
|
|
||||||
*/
|
|
||||||
public static function report(array $stats)
|
public static function report(array $stats)
|
||||||
{
|
{
|
||||||
$pid = null;
|
$pid = null;
|
||||||
@ -28,7 +25,7 @@ class Reporter
|
|||||||
if (is_null($pid) || $pid === -1) {
|
if (is_null($pid) || $pid === -1) {
|
||||||
// Fork fails or there is no `pcntl` extension.
|
// Fork fails or there is no `pcntl` extension.
|
||||||
try {
|
try {
|
||||||
Httpie::post(self::ENDPOINT)->body($stats)->send();
|
self::send($stats);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
@ -36,7 +33,7 @@ class Reporter
|
|||||||
// Child process.
|
// Child process.
|
||||||
posix_setsid();
|
posix_setsid();
|
||||||
try {
|
try {
|
||||||
Httpie::post(self::ENDPOINT)->body($stats)->send();
|
self::send($stats);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
@ -44,4 +41,12 @@ class Reporter
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function send(array $stats)
|
||||||
|
{
|
||||||
|
Httpie::post(self::ENDPOINT)
|
||||||
|
->body($stats)
|
||||||
|
->setopt(CURLOPT_SSL_VERIFYPEER, false)
|
||||||
|
->send();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user