Bundle certificate (fix #36)

This commit is contained in:
Pig Fang 2019-04-19 23:15:05 +08:00
parent ff4fa1eefa
commit ade8b0e5a6
5 changed files with 3411 additions and 2 deletions

View File

@ -107,7 +107,9 @@ class MarketController extends Controller
if (app()->environment('testing') || ! $this->registryCache) {
try {
$pluginsJson = $this->guzzle->request(
'GET', config('plugins.registry')
'GET',
config('plugins.registry'),
['verify' => resource_path('misc/ca-bundle.crt')],
)->getBody();
} catch (Exception $e) {
throw new Exception(trans('admin.plugins.market.connection-error', [

View File

@ -70,7 +70,11 @@ class UpdateController extends Controller
$acceptableSpec = 1;
if (! $this->info) {
try {
$json = $this->guzzle->request('GET', $this->updateSource)->getBody();
$json = $this->guzzle->request(
'GET',
$this->updateSource,
['verify' => resource_path('misc/ca-bundle.crt')],
)->getBody();
$info = json_decode($json, true);
if (Arr::get($info, 'spec') == $acceptableSpec) {
$this->info = $info;

View File

@ -23,6 +23,7 @@ class Captcha implements Rule
'secret' => $secretkey,
'response' => $value,
],
'verify' => resource_path('misc/ca-bundle.crt'),
]);
if ($response->getStatusCode() == 200) {
$body = json_decode((string) $response->getBody());

View File

@ -29,6 +29,7 @@ class PackageManager
$this->guzzle->request('GET', $url, [
'sink' => $path,
'progress' => $this->onProgress,
'verify' => resource_path('misc/ca-bundle.crt'),
]);
} catch (Exception $e) {
throw new Exception(trans('admin.download.errors.download', ['error' => $e->getMessage()]));

3401
resources/misc/ca-bundle.crt Executable file

File diff suppressed because it is too large Load Diff