作者 lyh

gx

... ... @@ -61,6 +61,7 @@ class DomainInfo extends Command
* @time :2023/9/11 15:07
*/
public function updateDomainSsl($domain){
try {
$context = stream_context_create([
'ssl' => [
'capture_peer_cert' => true,
... ... @@ -78,6 +79,10 @@ class DomainInfo extends Command
$valid_from = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validFrom_time_t']);
$valid_to = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validTo_time_t']);
fclose($stream);
}catch (\Exception $e){
$valid_from = '';
$valid_to = '';
}
return ['from'=>$valid_from,'to'=>$valid_to];
}
... ...