@@ -185,6 +185,8 @@ static int DH_set0_key(DH* dh, BIGNUM* pub_key, BIGNUM* priv_key) { |
185 | 185 | return 1; |
186 | 186 | } |
187 | 187 |
|
| 188 | +static const SSL_METHOD* TLS_method() { return SSLv23_method(); } |
| 189 | + |
188 | 190 | static void SSL_SESSION_get0_ticket(const SSL_SESSION* s, |
189 | 191 | const unsigned char** tick, size_t* len) { |
190 | 192 | *len = s->tlsext_ticklen; |
@@ -548,12 +550,12 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) { |
548 | 550 | ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); |
549 | 551 | Environment* env = sc->env(); |
550 | 552 |
|
551 | | - const SSL_METHOD* method = SSLv23_method(); |
| 553 | + const SSL_METHOD* method = TLS_method(); |
552 | 554 |
|
553 | 555 | if (args.Length() == 1 && args[0]->IsString()) { |
554 | 556 | const node::Utf8Value sslmethod(env->isolate(), args[0]); |
555 | 557 |
|
556 | | - // Note that SSLv2 and SSLv3 are disallowed but SSLv2_method and friends |
| 558 | + // Note that SSLv2 and SSLv3 are disallowed but SSLv23_method and friends |
557 | 559 | // are still accepted. They are OpenSSL's way of saying that all known |
558 | 560 | // protocols are supported unless explicitly disabled (which we do below |
559 | 561 | // for SSLv2 and SSLv3.) |
@@ -601,7 +603,7 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) { |
601 | 603 | sc->ctx_ = SSL_CTX_new(method); |
602 | 604 | SSL_CTX_set_app_data(sc->ctx_, sc); |
603 | 605 |
|
604 | | - // Disable SSLv2 in the case when method == SSLv23_method() and the |
| 606 | + // Disable SSLv2 in the case when method == TLS_method() and the |
605 | 607 | // cipher list contains SSLv2 ciphers (not the default, should be rare.) |
606 | 608 | // The bundled OpenSSL doesn't have SSLv2 support but the system OpenSSL may. |
607 | 609 | // SSLv3 is disabled because it's susceptible to downgrade attacks (POODLE.) |
@@ -5817,7 +5819,7 @@ void RandomBytesBuffer(const FunctionCallbackInfo<Value>& args) { |
5817 | 5819 | void GetSSLCiphers(const FunctionCallbackInfo<Value>& args) { |
5818 | 5820 | Environment* env = Environment::GetCurrent(args); |
5819 | 5821 |
|
5820 | | - SSL_CTX* ctx = SSL_CTX_new(TLSv1_server_method()); |
| 5822 | + SSL_CTX* ctx = SSL_CTX_new(TLS_method()); |
5821 | 5823 | CHECK_NE(ctx, nullptr); |
5822 | 5824 |
|
5823 | 5825 | SSL* ssl = SSL_new(ctx); |
|