[diff] handle building with OPENSSL_NO_SSL3

Stuart Henderson <[email protected]>
Newsgroups gmane.network.nagios.devel
Message-ID <slrnmtpua2.ksv.stu__46617.3070519746$1440545116$gmane$org@naiad.spacehopper.org>
Please would you consider taking this patch to support building on systems
with SSLv3 disabled?

Thanks
Stuart


From c0a0c792d1f7b69974219b84023afdd821b35b45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= <[email protected]>
Date: Sat, 25 Jul 2015 20:02:14 -0600
Subject: [PATCH] sslutils: Check if OpenSSL supports SSLv3.

---
 plugins/sslutils.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index d0ae474..4933dd0 100644
--- a/plugins/sslutils.c
+++ b/plugins/sslutils.c
@@ -66,7 +66,12 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
 #endif
 		break;
 	case 3: /* SSLv3 protocol */
+#if defined(OPENSSL_NO_SSL3)
+		printf(("%s\n", _("CRITICAL - SSL protocol version 3 is not supported by your SSL library.")));
+		return STATE_CRITICAL;
+#else
 		method = SSLv3_client_method();
+#endif
 		break;
 	default: /* Unsupported */
 		printf("%s\n", _("CRITICAL - Unsupported SSL protocol version."));
-- 
2.4.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.