diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2026-04-08 18:06:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-08 18:06:29 +0200 |
| commit | 3a6f9292f147de29b21dafa4cf9b7efce3e4cbfd (patch) | |
| tree | b7a2f64487a5a13753a14cd627550bcd95bc8eaf /plugins/check_curl.d/check_curl_helpers.c | |
| parent | 613cb60c96e21eaafb82b80a6b6d84b1b1f9729f (diff) | |
| download | monitoring-plugins-3a6f9292f147de29b21dafa4cf9b7efce3e4cbfd.tar.gz | |
Rename USE_OPENSSL to MOPL_USE_OPENSSL (#2253)
net-snmp uses the same pre processor name "USE_OPENSSL" as we do.
To avoid the conflict, this commit renames it on our side to
"MOPL_USE_OPENSSL".
"MOPL" (better "MoPl"?) stands for Monitoring Plugins.
Diffstat (limited to 'plugins/check_curl.d/check_curl_helpers.c')
| -rw-r--r-- | plugins/check_curl.d/check_curl_helpers.c | 16 |
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, |
