check_ssl_certificate - Handle the case of actually expired certificates

This commit is contained in:
Emmanuel BENOîT 2021-02-19 15:58:40 +01:00
parent ffe98f702b
commit 55c4a7b3a5

View file

@ -161,6 +161,9 @@ func (program *checkProgram) checkNames() bool {
// thresholds, returning a status code and description based on these // thresholds, returning a status code and description based on these
// values. // values.
func (program *checkProgram) checkCertificateExpiry(tlDays int) (plugin.Status, string) { func (program *checkProgram) checkCertificateExpiry(tlDays int) (plugin.Status, string) {
if tlDays <= 0 {
return plugin.CRITICAL, "certificate expired"
}
var limitStr string var limitStr string
var state plugin.Status var state plugin.Status
if program.crit > 0 && tlDays <= program.crit { if program.crit > 0 && tlDays <= program.crit {