Skip to content

Commit

Permalink
build: export deprecated OpenSSL symbols on Windows
Browse files Browse the repository at this point in the history
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: #25991
Refs: #20369
Refs: #25981
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
richardlau authored and targos committed Feb 11, 2019
1 parent d7ae105 commit d5d163d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions test/addons/openssl-binding/binding.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <node.h>
#include <assert.h>
#include <openssl/rand.h>
#include <openssl/ssl.h>

namespace {

Expand Down Expand Up @@ -28,6 +29,9 @@ inline void Initialize(v8::Local<v8::Object> exports,
->GetFunction(context)
.ToLocalChecked();
assert(exports->Set(context, key, value).IsJust());

const SSL_METHOD* method = TLSv1_2_server_method();
assert(method != nullptr);
}

} // anonymous namespace
Expand Down

0 comments on commit d5d163d

Please sign in to comment.