aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_curl.c
diff options
context:
space:
mode:
authorGravatar Andreas Baumann <mail@andreasbaumann.cc> 2019-11-07 15:31:52 +0000
committerGravatar Andreas Baumann <mail@andreasbaumann.cc> 2019-11-07 15:31:52 +0000
commit1b689dab5e64d4dfb76b81434cd5c4d50e988442 (patch)
treef0f64f8e2926f5e229f38f0badd0fa6c93e2c925 /plugins/check_curl.c
parentf7efee5f9c590ee0bea65d56697903cbf26d24c5 (diff)
downloadmonitoring-plugins-1b689dab5e64d4dfb76b81434cd5c4d50e988442.tar.gz
check_curl: NSS, parse more date formats from certificate (in -C cert check)
Diffstat (limited to 'plugins/check_curl.c')
-rw-r--r--plugins/check_curl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 796c55fc..5b6564c0 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;