|
@@ -26,7 +26,7 @@ discard block |
|
|
block discarded – undo |
|
26
|
26
|
$validTo = date('d.m.Y H:i:s', $certInfo['validTo_time_t']); |
|
27
|
27
|
|
|
28
|
28
|
if ($certInfo['validFrom_time_t'] > time() || $certInfo['validTo_time_t'] < time()) { |
|
29
|
|
- $errorMessage = 'Certificate is expired. [' . $validFrom . ' - ' . $validTo . ']'; |
|
|
29
|
+ $errorMessage = 'Certificate is expired. ['.$validFrom.' - '.$validTo.']'; |
|
30
|
30
|
|
|
31
|
31
|
$result = new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage); |
|
32
|
32
|
$infoJson = json_encode($certInfo); |
|
@@ -36,14 +36,14 @@ discard block |
|
|
block discarded – undo |
|
36
|
36
|
$result->addAttribute(new Attribute('certificate information', $infoJson, true)); |
|
37
|
37
|
} |
|
38
|
38
|
return $result; |
|
39
|
|
- } elseif ($certInfo['validTo_time_t'] < strtotime('+' . $this->expireWarningTime . 'days')) { |
|
40
|
|
- $errorMessage = 'Certificate warning, expires in less than ' . $this->expireWarningTime . ' days. Certificate expires at: ' . $validTo; |
|
|
39
|
+ } elseif ($certInfo['validTo_time_t'] < strtotime('+'.$this->expireWarningTime.'days')) { |
|
|
40
|
+ $errorMessage = 'Certificate warning, expires in less than '.$this->expireWarningTime.' days. Certificate expires at: '.$validTo; |
|
41
|
41
|
|
|
42
|
42
|
$result = new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage); |
|
43
|
43
|
$result->addAttribute(new Attribute('certificate information', json_encode($certInfo), true)); |
|
44
|
44
|
return $result; |
|
45
|
45
|
} |
|
46
|
46
|
|
|
47
|
|
- return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next ' . $this->expireWarningTime . ' days. Expire date: ' . $validTo . '.'); |
|
|
47
|
+ return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next '.$this->expireWarningTime.' days. Expire date: '.$validTo.'.'); |
|
48
|
48
|
} |
|
49
|
49
|
} |