...
|
...
|
@@ -10,6 +10,7 @@ |
|
|
|
|
|
use App\Models\BtSites;
|
|
|
use App\Repositories\Bt\Bt;
|
|
|
use Illuminate\Filesystem\Cache;
|
|
|
|
|
|
/**
|
|
|
* Class BtRepository
|
...
|
...
|
@@ -177,10 +178,16 @@ public function applySsl($host) |
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
|
|
if (Cache::get('apply_ssl_' . $host))
|
|
|
return false;
|
|
|
$domain = array_column($domain_list, 'name');
|
|
|
$result = $bt->ApplyCert(json_encode($domain), $site->site_id);
|
|
|
if (empty($result) || empty($result['cert']))
|
|
|
if (empty($result) || empty($result['cert'])) {
|
|
|
// 创建失败 host冻结15分钟
|
|
|
Cache::put('apply_ssl_' . $host, 1, 890);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$bt->SetSSL('1', $host, $result['private_key'], $result['cert']);
|
|
|
// 开启强制https
|
...
|
...
|
|