diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2021-06-24 17:08:20 (GMT) |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2021-06-24 17:08:20 (GMT) |
commit | 0b6838ffcaf372df419059771dd42f1bd69644c0 (patch) | |
tree | 2f44b6df69ff62e2310a7de62853916209a546bd | |
parent | 20e9451fadb452636bc4b395fcb6aaf93a477c23 (diff) | |
download | monitoring-plugins-0b6838ffcaf372df419059771dd42f1bd69644c0.tar.gz |
fix for missing X509_up_ref on old systems with only OpenSSL 1.0
-rw-r--r-- | plugins/check_curl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index d4442f5..daf64b0 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c | |||
@@ -55,6 +55,10 @@ const char *email = "devel@monitoring-plugins.org"; | |||
55 | 55 | ||
56 | #include <arpa/inet.h> | 56 | #include <arpa/inet.h> |
57 | 57 | ||
58 | #if defined(HAVE_SSL) && defined(USE_OPENSSL) | ||
59 | #include <openssl/opensslv.h> | ||
60 | #endif | ||
61 | |||
58 | #define MAKE_LIBCURL_VERSION(major, minor, patch) ((major)*0x10000 + (minor)*0x100 + (patch)) | 62 | #define MAKE_LIBCURL_VERSION(major, minor, patch) ((major)*0x10000 + (minor)*0x100 + (patch)) |
59 | 63 | ||
60 | #define DEFAULT_BUFFER_SIZE 2048 | 64 | #define DEFAULT_BUFFER_SIZE 2048 |
@@ -286,7 +290,9 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) | |||
286 | * TODO: is the last certificate always the server certificate? | 290 | * TODO: is the last certificate always the server certificate? |
287 | */ | 291 | */ |
288 | cert = X509_STORE_CTX_get_current_cert(x509_ctx); | 292 | cert = X509_STORE_CTX_get_current_cert(x509_ctx); |
293 | #if OPENSSL_VERSION_NUMBER >= 0x10100000L | ||
289 | X509_up_ref(cert); | 294 | X509_up_ref(cert); |
295 | #endif | ||
290 | if (verbose>=2) { | 296 | if (verbose>=2) { |
291 | puts("* SSL verify callback with certificate:"); | 297 | puts("* SSL verify callback with certificate:"); |
292 | X509_NAME *subject, *issuer; | 298 | X509_NAME *subject, *issuer; |