diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-05-04 08:16:33 +0000 |
---|---|---|
committer | Sven Nierlein <sven@nierlein.de> | 2018-10-22 16:30:31 +0200 |
commit | 6bc2646409a5dd64eee45a1a6f5210b5547b47fb (patch) | |
tree | e43ecc114b7ddd2e48660f449e5d98698ac6b5af /plugins | |
parent | 4b66d3d90acb6437972505d8acc56267dc119b22 (diff) | |
download | monitoring-plugins-6bc2646409a5dd64eee45a1a6f5210b5547b47fb.tar.gz |
more tolerant CERTINFO parsing
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_curl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 1aee5ebe..d96f8610 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c | |||
@@ -1841,18 +1841,18 @@ net_noopenssl_check_certificate (cert_ptr_union* cert_ptr, int days_till_exp_war | |||
1841 | /* find first common name in subject, TODO: check alternative subjects for | 1841 | /* find first common name in subject, TODO: check alternative subjects for |
1842 | * multi-host certificate, check wildcards | 1842 | * multi-host certificate, check wildcards |
1843 | */ | 1843 | */ |
1844 | if (strncmp (slist->data, "Subject:", 8) == 0) { | 1844 | if (strncasecmp (slist->data, "Subject:", 8) == 0) { |
1845 | char* p = strstr (slist->data, "CN="); | 1845 | char* p = strstr (slist->data, "CN="); |
1846 | if (p != NULL) { | 1846 | if (p != NULL) { |
1847 | if (strncmp (host_name, p+3, strlen (host_name)) == 0) { | 1847 | if (strncmp (host_name, p+3, strlen (host_name)) == 0) { |
1848 | cname_found = 1; | 1848 | cname_found = 1; |
1849 | } | 1849 | } |
1850 | } | 1850 | } |
1851 | } else if (strncmp (slist->data, "Start Date:", 11) == 0) { | 1851 | } else if (strncasecmp (slist->data, "Start Date:", 11) == 0) { |
1852 | start_date_str = &slist->data[11]; | 1852 | start_date_str = &slist->data[11]; |
1853 | } else if (strncmp (slist->data, "Expire Date:", 12) == 0) { | 1853 | } else if (strncasecmp (slist->data, "Expire Date:", 12) == 0) { |
1854 | end_date_str = &slist->data[12]; | 1854 | end_date_str = &slist->data[12]; |
1855 | } else if (strncmp (slist->data, "Cert:", 5) == 0) { | 1855 | } else if (strncasecmp (slist->data, "Cert:", 5) == 0) { |
1856 | goto HAVE_FIRST_CERT; | 1856 | goto HAVE_FIRST_CERT; |
1857 | } | 1857 | } |
1858 | if (verbose >= 2) | 1858 | if (verbose >= 2) |