[monitoring-plugins] check_curl: NSS, parse more date formats from ...
Andreas Baumann <[email protected]> Thu, 7 Nov 2019 16:40:11 +0100 (CET)
| Newsgroups | gmane.network.nagios.cvs |
|---|---|
| Message-ID | <20191107154011.76DE22002475__34098.5202741408$1573141221$gmane$org@orwell.monitoring-plugins.org> |
Module: monitoring-plugins Branch: feature_check_curl Commit: 1b689dab5e64d4dfb76b81434cd5c4d50e988442 Author: Andreas Baumann <[email protected]> Date: Thu Nov 7 15:31:52 2019 +0000 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=1b689da check_curl: NSS, parse more date formats from certificate (in -C cert check) --- plugins/check_curl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 796c55f..5b6564c 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -2181,10 +2181,14 @@ parse_cert_date (const char *s) { struct tm tm; time_t date; + char *res; if (!s) return -1; - strptime (s, "%Y-%m-%d %H:%M:%S GMT", &tm); + /* Jan 17 14:25:12 2020 GMT */ + res = strptime (s, "%Y-%m-%d %H:%M:%S GMT", &tm); + /* Sep 11 12:00:00 2020 GMT */ + if (res == NULL) strptime (s, "%Y %m %d %H:%M:%S GMT", &tm); date = mktime (&tm); return date;