aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Andreas Baumann <mail@andreasbaumann.cc> 2021-06-24 17:08:20 +0000
committerGravatar Andreas Baumann <mail@andreasbaumann.cc> 2021-06-24 17:08:20 +0000
commit0b6838ffcaf372df419059771dd42f1bd69644c0 (patch)
tree2f44b6df69ff62e2310a7de62853916209a546bd
parent20e9451fadb452636bc4b395fcb6aaf93a477c23 (diff)
downloadmonitoring-plugins-0b6838ffcaf372df419059771dd42f1bd69644c0.tar.gz
fix for missing X509_up_ref on old systems with only OpenSSL 1.0
-rw-r--r--plugins/check_curl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index d4442f51..daf64b0b 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -55,6 +55,10 @@ const char *email = "devel@monitoring-plugins.org";
#include <arpa/inet.h>
+#if defined(HAVE_SSL) && defined(USE_OPENSSL)
+#include <openssl/opensslv.h>
+#endif
+
#define MAKE_LIBCURL_VERSION(major, minor, patch) ((major)*0x10000 + (minor)*0x100 + (patch))
#define DEFAULT_BUFFER_SIZE 2048
@@ -286,7 +290,9 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
* TODO: is the last certificate always the server certificate?
*/
cert = X509_STORE_CTX_get_current_cert(x509_ctx);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
X509_up_ref(cert);
+#endif
if (verbose>=2) {
puts("* SSL verify callback with certificate:");
X509_NAME *subject, *issuer;