summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2014-12-06 18:52:25 +0000
committerFedor Indutny <fedor@indutny.com>2014-12-10 15:48:38 +0700
commitac18ebddbdf4b2d3fdfeb4e3b10619e38c87b4ca (patch)
tree043f5f6e2ff773c01192a7e2578d2584e5ff61be /src
parent21a679a10fae05d3c590f08feb70a9c97ea8a732 (diff)
downloadnode-new-ac18ebddbdf4b2d3fdfeb4e3b10619e38c87b4ca.tar.gz
crypto: disable SSLv3 if shared OpenSSL lacks it
Some distributions disable SSLv3 due to POODLE. In such a case, disable the specific SSLv3 methods and throw an exception, much like the code already does for SSLv2. The SSLv23* code is retained because this is OpenSSL's terminology for "no version in particular". Reviewed-By: Fedor Indutny <fedor@indutny.com> PR-URL: https://github.com/iojs/io.js/pull/101
Diffstat (limited to 'src')
-rw-r--r--src/node_crypto.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index eec8b560fa..efaa390ff3 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -328,11 +328,23 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
return env->ThrowError("SSLv2 methods disabled");
#endif
} else if (strcmp(*sslmethod, "SSLv3_method") == 0) {
+#ifndef OPENSSL_NO_SSL3
method = SSLv3_method();
+#else
+ return env->ThrowError("SSLv3 methods disabled");
+#endif
} else if (strcmp(*sslmethod, "SSLv3_server_method") == 0) {
+#ifndef OPENSSL_NO_SSL3
method = SSLv3_server_method();
+#else
+ return env->ThrowError("SSLv3 methods disabled");
+#endif
} else if (strcmp(*sslmethod, "SSLv3_client_method") == 0) {
+#ifndef OPENSSL_NO_SSL3
method = SSLv3_client_method();
+#else
+ return env->ThrowError("SSLv3 methods disabled");
+#endif
} else if (strcmp(*sslmethod, "SSLv23_method") == 0) {
method = SSLv23_method();
} else if (strcmp(*sslmethod, "SSLv23_server_method") == 0) {