Skip to content

Commit 10f63cd

Browse files
committed
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".
1 parent b928303 commit 10f63cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/node_crypto.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,23 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
326326
return env->ThrowError("SSLv2 methods disabled");
327327
#endif
328328
} else if (strcmp(*sslmethod, "SSLv3_method") == 0) {
329+
#ifndef OPENSSL_NO_SSL3
329330
method = SSLv3_method();
331+
#else
332+
return env->ThrowError("SSLv3 methods disabled");
333+
#endif
330334
} else if (strcmp(*sslmethod, "SSLv3_server_method") == 0) {
335+
#ifndef OPENSSL_NO_SSL3
331336
method = SSLv3_server_method();
337+
#else
338+
return env->ThrowError("SSLv3 methods disabled");
339+
#endif
332340
} else if (strcmp(*sslmethod, "SSLv3_client_method") == 0) {
341+
#ifndef OPENSSL_NO_SSL3
333342
method = SSLv3_client_method();
343+
#else
344+
return env->ThrowError("SSLv3 methods disabled");
345+
#endif
334346
} else if (strcmp(*sslmethod, "SSLv23_method") == 0) {
335347
method = SSLv23_method();
336348
} else if (strcmp(*sslmethod, "SSLv23_server_method") == 0) {

0 commit comments

Comments
 (0)