From 5dcfe24a1bfa94e9ba8e8158958c81ad0275eb75 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 15 Nov 2018 15:48:24 -0800 Subject: [PATCH] tls: support TLS_client_method, TLS_server_method Add the two TLS protocol method functions which were missing. They seem useful, and are already documented as being supported (indirectly, our docs just point to OpenSSL's docs). --- src/node_crypto.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 1842d03dcbb87d..284616f85428ce 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -431,6 +431,14 @@ void SecureContext::Init(const FunctionCallbackInfo& args) { } else if (strcmp(*sslmethod, "TLS_method") == 0) { min_version = 0; max_version = 0; + } else if (strcmp(*sslmethod, "TLS_server_method") == 0) { + min_version = 0; + max_version = 0; + method = TLS_server_method(); + } else if (strcmp(*sslmethod, "TLS_client_method") == 0) { + min_version = 0; + max_version = 0; + method = TLS_client_method(); } else if (strcmp(*sslmethod, "TLSv1_method") == 0) { min_version = TLS1_VERSION; max_version = TLS1_VERSION;