diff options
Diffstat (limited to 'plugins/check_curl.c')
| -rw-r--r-- | plugins/check_curl.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index b168cbcd..fe7e61d6 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c | |||
| @@ -62,7 +62,7 @@ const char *email = "devel@monitoring-plugins.org"; | |||
| 62 | #include <arpa/inet.h> | 62 | #include <arpa/inet.h> |
| 63 | #include <netinet/in.h> | 63 | #include <netinet/in.h> |
| 64 | 64 | ||
| 65 | #if defined(HAVE_SSL) && defined(USE_OPENSSL) | 65 | #if defined(HAVE_SSL) && defined(MOPL_USE_OPENSSL) |
| 66 | # include <openssl/opensslv.h> | 66 | # include <openssl/opensslv.h> |
| 67 | #endif | 67 | #endif |
| 68 | 68 | ||
| @@ -81,9 +81,9 @@ extern char errbuf[MAX_INPUT_BUFFER]; | |||
| 81 | extern bool is_openssl_callback; | 81 | extern bool is_openssl_callback; |
| 82 | extern bool add_sslctx_verify_fun; | 82 | extern bool add_sslctx_verify_fun; |
| 83 | 83 | ||
| 84 | #if defined(HAVE_SSL) && defined(USE_OPENSSL) | 84 | #if defined(HAVE_SSL) && defined(MOPL_USE_OPENSSL) |
| 85 | static X509 *cert = NULL; | 85 | static X509 *cert = NULL; |
| 86 | #endif /* defined(HAVE_SSL) && defined(USE_OPENSSL) */ | 86 | #endif /* defined(HAVE_SSL) && defined(MOPL_USE_OPENSSL) */ |
| 87 | 87 | ||
| 88 | typedef struct { | 88 | typedef struct { |
| 89 | int errorcode; | 89 | int errorcode; |
| @@ -114,10 +114,10 @@ static void print_curl_version(void); | |||
| 114 | // check_curl_evaluation_wrapper check_curl_evaluate(check_curl_config config, | 114 | // check_curl_evaluation_wrapper check_curl_evaluate(check_curl_config config, |
| 115 | // mp_check overall[static 1]) {} | 115 | // mp_check overall[static 1]) {} |
| 116 | 116 | ||
| 117 | #if defined(HAVE_SSL) && defined(USE_OPENSSL) | 117 | #if defined(HAVE_SSL) && defined(MOPL_USE_OPENSSL) |
| 118 | mp_state_enum np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, | 118 | mp_state_enum np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, |
| 119 | int days_till_exp_crit); | 119 | int days_till_exp_crit); |
| 120 | #endif /* defined(HAVE_SSL) && defined(USE_OPENSSL) */ | 120 | #endif /* defined(HAVE_SSL) && defined(MOPL_USE_OPENSSL) */ |
| 121 | 121 | ||
| 122 | int main(int argc, char **argv) { | 122 | int main(int argc, char **argv) { |
| 123 | #ifdef __OpenBSD__ | 123 | #ifdef __OpenBSD__ |
| @@ -167,7 +167,7 @@ int main(int argc, char **argv) { | |||
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | #ifdef HAVE_SSL | 169 | #ifdef HAVE_SSL |
| 170 | # ifdef USE_OPENSSL | 170 | # ifdef MOPL_USE_OPENSSL |
| 171 | int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) { | 171 | int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) { |
| 172 | (void)preverify_ok; | 172 | (void)preverify_ok; |
| 173 | /* TODO: we get all certificates of the chain, so which ones | 173 | /* TODO: we get all certificates of the chain, so which ones |
| @@ -190,11 +190,11 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) { | |||
| 190 | } | 190 | } |
| 191 | return 1; | 191 | return 1; |
| 192 | } | 192 | } |
| 193 | # endif /* USE_OPENSSL */ | 193 | # endif /* MOPL_USE_OPENSSL */ |
| 194 | #endif /* HAVE_SSL */ | 194 | #endif /* HAVE_SSL */ |
| 195 | 195 | ||
| 196 | #ifdef HAVE_SSL | 196 | #ifdef HAVE_SSL |
| 197 | # ifdef USE_OPENSSL | 197 | # ifdef MOPL_USE_OPENSSL |
| 198 | CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm) { | 198 | CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm) { |
| 199 | (void)curl; // ignore unused parameter | 199 | (void)curl; // ignore unused parameter |
| 200 | (void)parm; // ignore unused parameter | 200 | (void)parm; // ignore unused parameter |
| @@ -211,7 +211,7 @@ CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm) { | |||
| 211 | 211 | ||
| 212 | return CURLE_OK; | 212 | return CURLE_OK; |
| 213 | } | 213 | } |
| 214 | # endif /* USE_OPENSSL */ | 214 | # endif /* MOPL_USE_OPENSSL */ |
| 215 | #endif /* HAVE_SSL */ | 215 | #endif /* HAVE_SSL */ |
| 216 | 216 | ||
| 217 | mp_subcheck check_http(const check_curl_config config, check_curl_working_state workingState, | 217 | mp_subcheck check_http(const check_curl_config config, check_curl_working_state workingState, |
| @@ -1867,7 +1867,7 @@ void print_usage(void) { | |||
| 1867 | void print_curl_version(void) { printf("%s\n", curl_version()); } | 1867 | void print_curl_version(void) { printf("%s\n", curl_version()); } |
| 1868 | 1868 | ||
| 1869 | #ifdef LIBCURL_FEATURE_SSL | 1869 | #ifdef LIBCURL_FEATURE_SSL |
| 1870 | # ifndef USE_OPENSSL | 1870 | # ifndef MOPL_USE_OPENSSL |
| 1871 | time_t parse_cert_date(const char *s) { | 1871 | time_t parse_cert_date(const char *s) { |
| 1872 | if (!s) { | 1872 | if (!s) { |
| 1873 | return -1; | 1873 | return -1; |
| @@ -1884,11 +1884,11 @@ time_t parse_cert_date(const char *s) { | |||
| 1884 | 1884 | ||
| 1885 | return date; | 1885 | return date; |
| 1886 | } | 1886 | } |
| 1887 | # endif /* USE_OPENSSL */ | 1887 | # endif /* MOPL_USE_OPENSSL */ |
| 1888 | #endif /* LIBCURL_FEATURE_SSL */ | 1888 | #endif /* LIBCURL_FEATURE_SSL */ |
| 1889 | 1889 | ||
| 1890 | #ifdef LIBCURL_FEATURE_SSL | 1890 | #ifdef LIBCURL_FEATURE_SSL |
| 1891 | # ifndef USE_OPENSSL | 1891 | # ifndef MOPL_USE_OPENSSL |
| 1892 | /* TODO: this needs cleanup in the sslutils.c, maybe we the #else case to | 1892 | /* TODO: this needs cleanup in the sslutils.c, maybe we the #else case to |
| 1893 | * OpenSSL could be this function | 1893 | * OpenSSL could be this function |
| 1894 | */ | 1894 | */ |
| @@ -2025,5 +2025,5 @@ int net_noopenssl_check_certificate(cert_ptr_union *cert_ptr, int days_till_exp_ | |||
| 2025 | } | 2025 | } |
| 2026 | return status; | 2026 | return status; |
| 2027 | } | 2027 | } |
| 2028 | # endif /* USE_OPENSSL */ | 2028 | # endif /* MOPL_USE_OPENSSL */ |
| 2029 | #endif /* LIBCURL_FEATURE_SSL */ | 2029 | #endif /* LIBCURL_FEATURE_SSL */ |
