|
@@ -11,8 +11,7 @@ class GetSSLDaysController {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- exec("sudo certbot certificates --cert-name $domain | grep 'Expiry' | sed 's/..:..:..+..:..../\n/g
|
|
|
|
|
-'", $phpOutput, $phpReturnCode);
|
|
|
|
|
|
|
+ exec("sudo certbot certificates --cert-name $domain | grep 'Expiry' | sed 's/..:..:..+..:..../\n/g' | sed 's/days)//g' | sed 's/[[:space:]]//g' | cut -d: -f2", $phpOutput, $phpReturnCode);
|
|
|
$sslData = implode("\n",$phpOutput);
|
|
$sslData = implode("\n",$phpOutput);
|
|
|
/*
|
|
/*
|
|
|
$certFile = "/etc/letsencrypt/live/$domain/fullchain.pem";
|
|
$certFile = "/etc/letsencrypt/live/$domain/fullchain.pem";
|
|
@@ -22,6 +21,7 @@ class GetSSLDaysController {
|
|
|
echo json_encode(['error' => 'SSL certificate not found']);
|
|
echo json_encode(['error' => 'SSL certificate not found']);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ [ssl_expiry] => Expiry Date: 2025-08-05 08:21:58+00:00 (VALID: 86 days)
|
|
|
|
|
|
|
|
$certData = openssl_x509_parse(file_get_contents($certFile));
|
|
$certData = openssl_x509_parse(file_get_contents($certFile));
|
|
|
if (!$certData || !isset($certData['validTo_time_t'])) {
|
|
if (!$certData || !isset($certData['validTo_time_t'])) {
|