@@ -238,24 +238,6 @@ Handle<Value> SecureContext::New(const Arguments& args) {
238
238
}
239
239
240
240
241
- bool MaybeThrowSSL3 () {
242
- if (!SSL3_ENABLE) {
243
- ThrowException (Exception::Error (String::New (" SSLv3 is considered unsafe, see node --help" )));
244
- return true ;
245
- } else {
246
- return false ;
247
- }
248
- }
249
-
250
- bool MaybeThrowSSL2 () {
251
- if (!SSL2_ENABLE) {
252
- ThrowException (Exception::Error (String::New (" SSLv2 is considered unsafe, see node --help" )));
253
- return true ;
254
- } else {
255
- return false ;
256
- }
257
- }
258
-
259
241
Handle <Value> SecureContext::Init (const Arguments& args) {
260
242
HandleScope scope;
261
243
@@ -268,42 +250,36 @@ Handle<Value> SecureContext::Init(const Arguments& args) {
268
250
269
251
if (strcmp (*sslmethod, " SSLv2_method" ) == 0 ) {
270
252
#ifndef OPENSSL_NO_SSL2
271
- if (MaybeThrowSSL2 ()) return Undefined ();
272
253
method = SSLv2_method ();
273
254
#else
274
255
return ThrowException (Exception::Error (String::New (" SSLv2 methods disabled" )));
275
256
#endif
276
257
} else if (strcmp (*sslmethod, " SSLv2_server_method" ) == 0 ) {
277
258
#ifndef OPENSSL_NO_SSL2
278
- if (MaybeThrowSSL2 ()) return Undefined ();
279
259
method = SSLv2_server_method ();
280
260
#else
281
261
return ThrowException (Exception::Error (String::New (" SSLv2 methods disabled" )));
282
262
#endif
283
263
} else if (strcmp (*sslmethod, " SSLv2_client_method" ) == 0 ) {
284
264
#ifndef OPENSSL_NO_SSL2
285
- if (MaybeThrowSSL2 ()) return Undefined ();
286
265
method = SSLv2_client_method ();
287
266
#else
288
267
return ThrowException (Exception::Error (String::New (" SSLv2 methods disabled" )));
289
268
#endif
290
269
} else if (strcmp (*sslmethod, " SSLv3_method" ) == 0 ) {
291
270
#ifndef OPENSSL_NO_SSL3
292
- if (MaybeThrowSSL3 ()) return Undefined ();
293
271
method = SSLv3_method ();
294
272
#else
295
273
return ThrowException (Exception::Error (String::New (" SSLv3 methods disabled" )));
296
274
#endif
297
275
} else if (strcmp (*sslmethod, " SSLv3_server_method" ) == 0 ) {
298
276
#ifndef OPENSSL_NO_SSL3
299
- if (MaybeThrowSSL3 ()) return Undefined ();
300
277
method = SSLv3_server_method ();
301
278
#else
302
279
return ThrowException (Exception::Error (String::New (" SSLv3 methods disabled" )));
303
280
#endif
304
281
} else if (strcmp (*sslmethod, " SSLv3_client_method" ) == 0 ) {
305
282
#ifndef OPENSSL_NO_SSL3
306
- if (MaybeThrowSSL3 ()) return Undefined ();
307
283
method = SSLv3_client_method ();
308
284
#else
309
285
return ThrowException (Exception::Error (String::New (" SSLv3 methods disabled" )));
0 commit comments