正在显示
1 个修改的文件
包含
5 行增加
和
0 行删除
| @@ -61,6 +61,7 @@ class DomainInfo extends Command | @@ -61,6 +61,7 @@ class DomainInfo extends Command | ||
| 61 | * @time :2023/9/11 15:07 | 61 | * @time :2023/9/11 15:07 |
| 62 | */ | 62 | */ |
| 63 | public function updateDomainSsl($domain){ | 63 | public function updateDomainSsl($domain){ |
| 64 | + try { | ||
| 64 | $context = stream_context_create([ | 65 | $context = stream_context_create([ |
| 65 | 'ssl' => [ | 66 | 'ssl' => [ |
| 66 | 'capture_peer_cert' => true, | 67 | 'capture_peer_cert' => true, |
| @@ -78,6 +79,10 @@ class DomainInfo extends Command | @@ -78,6 +79,10 @@ class DomainInfo extends Command | ||
| 78 | $valid_from = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validFrom_time_t']); | 79 | $valid_from = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validFrom_time_t']); |
| 79 | $valid_to = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validTo_time_t']); | 80 | $valid_to = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validTo_time_t']); |
| 80 | fclose($stream); | 81 | fclose($stream); |
| 82 | + }catch (\Exception $e){ | ||
| 83 | + $valid_from = ''; | ||
| 84 | + $valid_to = ''; | ||
| 85 | + } | ||
| 81 | return ['from'=>$valid_from,'to'=>$valid_to]; | 86 | return ['from'=>$valid_from,'to'=>$valid_to]; |
| 82 | } | 87 | } |
| 83 | 88 |
-
请 注册 或 登录 后发表评论