From d5d163d8b90d8f7a97ed48c93c908ac800da3945 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 7 Feb 2019 19:20:25 +0000 Subject: [PATCH] build: export deprecated OpenSSL symbols on Windows Methods such as `TLSv1_server_method` are categorized as `DEPRECATEDIN_1_1_0`. Add the deprecated categories to the list of categories to include passed to `mkssldef.py`. Adds a regression test to `test/addons/openssl-binding`. PR-URL: https://github.com/nodejs/node/pull/25991 Refs: https://github.com/nodejs/node/issues/20369 Refs: https://github.com/nodejs/node/issues/25981 Reviewed-By: Sam Roberts Reviewed-By: Ben Noordhuis --- node.gyp | 2 +- test/addons/openssl-binding/binding.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/node.gyp b/node.gyp index ae5578b72ec952..a84bd5b7818009 100644 --- a/node.gyp +++ b/node.gyp @@ -709,7 +709,7 @@ '-CAES,BF,BIO,DES,DH,DSA,EC,ECDH,ECDSA,ENGINE,EVP,HMAC,MD4,MD5,' 'PSK,RC2,RC4,RSA,SHA,SHA0,SHA1,SHA256,SHA512,SOCK,STDIO,TLSEXT,' 'FP_API,TLS1_METHOD,TLS1_1_METHOD,TLS1_2_METHOD,SCRYPT,OCSP,' - 'NEXTPROTONEG,RMD160,CAST', + 'NEXTPROTONEG,RMD160,CAST,DEPRECATEDIN_1_1_0,DEPRECATEDIN_1_2_0', # Defines. '-DWIN32', # Symbols to filter from the export list. diff --git a/test/addons/openssl-binding/binding.cc b/test/addons/openssl-binding/binding.cc index 122d420bc14e0b..ecda40f4cb50a3 100644 --- a/test/addons/openssl-binding/binding.cc +++ b/test/addons/openssl-binding/binding.cc @@ -1,6 +1,7 @@ #include #include #include +#include namespace { @@ -28,6 +29,9 @@ inline void Initialize(v8::Local exports, ->GetFunction(context) .ToLocalChecked(); assert(exports->Set(context, key, value).IsJust()); + + const SSL_METHOD* method = TLSv1_2_server_method(); + assert(method != nullptr); } } // anonymous namespace