src: fix build error without OpenSSL support

PR #3890 [1] introduced the variable ALLOW_INSECURE_SERVER_DHPARAM defined
in src/node_crypto.cc. However, if nodejs is built without OpenSSL support,
the build fails:
 error: ‘ALLOW_INSECURE_SERVER_DHPARAM’ was not declared in this scope
       ALLOW_INSECURE_SERVER_DHPARAM = true;

Fix this by using the preprocessor macro HAVE_OPENSSL to opt-out the use of
ALLOW_INSECURE_SERVER_DHPARAM in non-OpenSSL builds.

[1] https://github.com/nodejs/node/pull/3890

PR-URL: https://github.com/nodejs/node/pull/4201
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
This commit is contained in:
Jörg Krause authored and Myles Borins committed 2016-02-11 11:29:14 -08:00
1 parent da66166b9a
commit 28dddabf6a
1 file changed
+2
+2
View File
@@ -3054,7 +3054,9 @@ static void ParseArgs(int* argc,
SSL3_ENABLE = true;
#endif
} else if (strcmp(arg, "--allow-insecure-server-dhparam") == 0) {
#if HAVE_OPENSSL
ALLOW_INSECURE_SERVER_DHPARAM = true;
#endif
} else if (strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) {
PrintHelp();
exit(0);