diff options
| author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-05-04 08:16:33 +0000 |
|---|---|---|
| committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-05-04 08:16:33 +0000 |
| commit | 0390474e9f3f7f8dcaa8ded5d009062deefd35a6 (patch) | |
| tree | 71d6cd0309eaf51b76cc9bae649da22a7475f519 | |
| parent | f433931fa0fda9a8fce06a6e30d6a87dfd4be682 (diff) | |
| download | monitoring-plugins-0390474.tar.gz | |
more tolerant CERTINFO parsing
| -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) |
