From 54b4beb506dc9b830f21442c68a0be8be58a2ef8 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). PR-URL: https://github.com/nodejs/node/pull/24386 Reviewed-By: Vse Mozhet Byt Reviewed-By: Daniel Bevenius Reviewed-By: Ujjwal Sharma --- src/node_crypto.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 066d67c0f075ae..cf508213142cb9 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;