]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_openssl.cpp
sslinfo: use the SSL certificate API to get user SSL certificates.
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_openssl.cpp
index 3ebc8e4d91685b258e9961220790ad3c2a0f7ef4..8d6b1e98ca1675f70042921e64c60cc6c51a523c 100644 (file)
 #include "iohook.h"
 #include "modules/ssl.h"
 
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+#endif
+
 // Ignore OpenSSL deprecation warnings on OS X Lion and newer.
 #if defined __APPLE__
 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <openssl/err.h>
 #include <openssl/dh.h>
 
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
+
 #ifdef _WIN32
 # pragma comment(lib, "ssleay32.lib")
 # pragma comment(lib, "libeay32.lib")
@@ -336,14 +344,29 @@ namespace OpenSSL
                {
                        long setoptions = tag->getInt(ctxname + "setoptions", 0);
                        long clearoptions = tag->getInt(ctxname + "clearoptions", 0);
+
 #ifdef SSL_OP_NO_COMPRESSION
-                       if (!tag->getBool("compression", false)) // Disable compression by default
+                       // Disable compression by default
+                       if (!tag->getBool("compression", false))
                                setoptions |= SSL_OP_NO_COMPRESSION;
 #endif
+
                        // Disable TLSv1.0 by default.
                        if (!tag->getBool("tlsv1", false))
                                setoptions |= SSL_OP_NO_TLSv1;
 
+#ifdef SSL_OP_NO_TLSv1_1
+                       // Enable TLSv1.1 by default.
+                       if (!tag->getBool("tlsv11", true))
+                               setoptions |= SSL_OP_NO_TLSv1_1;
+#endif
+
+#ifdef SSL_OP_NO_TLSv1_2
+                       // Enable TLSv1.2 by default.
+                       if (!tag->getBool("tlsv12", true))
+                               setoptions |= SSL_OP_NO_TLSv1_2;
+#endif
+
                        if (!setoptions && !clearoptions)
                                return; // Nothing to do