summaryrefslogtreecommitdiffstats
path: root/plugins/check_curl.d
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_curl.d')
-rw-r--r--plugins/check_curl.d/check_curl_helpers.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/check_curl.d/check_curl_helpers.c b/plugins/check_curl.d/check_curl_helpers.c
index f23dbdb7..80d6f4f6 100644
--- a/plugins/check_curl.d/check_curl_helpers.c
+++ b/plugins/check_curl.d/check_curl_helpers.c
@@ -439,11 +439,11 @@ check_curl_configure_curl(const check_curl_static_curl_config config,
439 case CURLHELP_SSL_LIBRARY_LIBRESSL: 439 case CURLHELP_SSL_LIBRARY_LIBRESSL:
440 /* set callback to extract certificate with OpenSSL context function (works with 440 /* set callback to extract certificate with OpenSSL context function (works with
441 * OpenSSL-style libraries only!) */ 441 * OpenSSL-style libraries only!) */
442# ifdef USE_OPENSSL 442# ifdef MOPL_USE_OPENSSL
443 /* libcurl and monitoring plugins built with OpenSSL, good */ 443 /* libcurl and monitoring plugins built with OpenSSL, good */
444 add_sslctx_verify_fun = true; 444 add_sslctx_verify_fun = true;
445 is_openssl_callback = true; 445 is_openssl_callback = true;
446# endif /* USE_OPENSSL */ 446# endif /* MOPL_USE_OPENSSL */
447 /* libcurl is built with OpenSSL, monitoring plugins, so falling 447 /* libcurl is built with OpenSSL, monitoring plugins, so falling
448 * back to manually extracting certificate information */ 448 * back to manually extracting certificate information */
449 handle_curl_option_return_code( 449 handle_curl_option_return_code(
@@ -1312,16 +1312,16 @@ mp_subcheck check_curl_certificate_checks(CURL *curl, X509 *cert, int warn_days_
1312 1312
1313#ifdef LIBCURL_FEATURE_SSL 1313#ifdef LIBCURL_FEATURE_SSL
1314 if (is_openssl_callback) { 1314 if (is_openssl_callback) {
1315# ifdef USE_OPENSSL 1315# ifdef MOPL_USE_OPENSSL
1316 /* check certificate with OpenSSL functions, curl has been built against OpenSSL 1316 /* check certificate with OpenSSL functions, curl has been built against OpenSSL
1317 * and we actually have OpenSSL in the monitoring tools 1317 * and we actually have OpenSSL in the monitoring tools
1318 */ 1318 */
1319 return mp_net_ssl_check_certificate(cert, warn_days_till_exp, crit_days_till_exp); 1319 return mp_net_ssl_check_certificate(cert, warn_days_till_exp, crit_days_till_exp);
1320# else /* USE_OPENSSL */ 1320# else /* MOPL_USE_OPENSSL */
1321 xasprintf(&result.output, "HTTP CRITICAL - Cannot retrieve certificates - OpenSSL " 1321 xasprintf(&result.output, "HTTP CRITICAL - Cannot retrieve certificates - OpenSSL "
1322 "callback used and not linked against OpenSSL\n"); 1322 "callback used and not linked against OpenSSL\n");
1323 mp_set_subcheck_state(result, STATE_CRITICAL); 1323 mp_set_subcheck_state(result, STATE_CRITICAL);
1324# endif /* USE_OPENSSL */ 1324# endif /* MOPL_USE_OPENSSL */
1325 } else { 1325 } else {
1326 struct curl_slist *slist; 1326 struct curl_slist *slist;
1327 1327
@@ -1329,7 +1329,7 @@ mp_subcheck check_curl_certificate_checks(CURL *curl, X509 *cert, int warn_days_
1329 cert_ptr.to_info = NULL; 1329 cert_ptr.to_info = NULL;
1330 CURLcode res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &cert_ptr.to_certinfo); 1330 CURLcode res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &cert_ptr.to_certinfo);
1331 if (!res && cert_ptr.to_info) { 1331 if (!res && cert_ptr.to_info) {
1332# ifdef USE_OPENSSL 1332# ifdef MOPL_USE_OPENSSL
1333 /* We have no OpenSSL in libcurl, but we can use OpenSSL for X509 cert 1333 /* We have no OpenSSL in libcurl, but we can use OpenSSL for X509 cert
1334 * parsing We only check the first certificate and assume it's the one of 1334 * parsing We only check the first certificate and assume it's the one of
1335 * the server 1335 * the server
@@ -1375,13 +1375,13 @@ mp_subcheck check_curl_certificate_checks(CURL *curl, X509 *cert, int warn_days_
1375 1375
1376 BIO_free(cert_BIO); 1376 BIO_free(cert_BIO);
1377 return mp_net_ssl_check_certificate(cert, warn_days_till_exp, crit_days_till_exp); 1377 return mp_net_ssl_check_certificate(cert, warn_days_till_exp, crit_days_till_exp);
1378# else /* USE_OPENSSL */ 1378# else /* MOPL_USE_OPENSSL */
1379 /* We assume we don't have OpenSSL and np_net_ssl_check_certificate at our 1379 /* We assume we don't have OpenSSL and np_net_ssl_check_certificate at our
1380 * disposal, so we use the libcurl CURLINFO data 1380 * disposal, so we use the libcurl CURLINFO data
1381 */ 1381 */
1382 return net_noopenssl_check_certificate(&cert_ptr, days_till_exp_warn, 1382 return net_noopenssl_check_certificate(&cert_ptr, days_till_exp_warn,
1383 days_till_exp_crit); 1383 days_till_exp_crit);
1384# endif /* USE_OPENSSL */ 1384# endif /* MOPL_USE_OPENSSL */
1385 } else { 1385 } else {
1386 xasprintf(&sc_cert_result.output, 1386 xasprintf(&sc_cert_result.output,
1387 _("Cannot retrieve certificates - cURL returned %d - %s"), res, 1387 _("Cannot retrieve certificates - cURL returned %d - %s"), res,