diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2018-11-15 15:48:24 -0800 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2018-11-19 11:21:11 -0800 |
commit | 54b4beb506dc9b830f21442c68a0be8be58a2ef8 (patch) | |
tree | fa5e5e7247c9d03617e732e75abdac6836bf49c3 /src/node_crypto.cc | |
parent | eb42c1eb4f2502433a22c49ede9e657fb6cd86e0 (diff) | |
download | android-node-v8-54b4beb506dc9b830f21442c68a0be8be58a2ef8.tar.gz android-node-v8-54b4beb506dc9b830f21442c68a0be8be58a2ef8.tar.bz2 android-node-v8-54b4beb506dc9b830f21442c68a0be8be58a2ef8.zip |
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 <vsemozhetbyt@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Diffstat (limited to 'src/node_crypto.cc')
-rw-r--r-- | src/node_crypto.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 066d67c0f0..cf50821314 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -431,6 +431,14 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& 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; |