Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lib: suppress crypto related env vars in help msg
This commit adds a crypto check to suppress the crypto related
environment variables introduced in Commit
399bb3c ("doc: add NODE_DEBUG_NATIVE to API
docs").

Without this check, test/parallel/test-cli-node-print-help.js will fail
when configured --without-ssl, as it some of the descriptions for these
environment variables contain flags that the test is not expecting to find.
  • Loading branch information
danbev committed Nov 21, 2018
commit 2042d127c13d591612c9fb0ba850b09748151d9c
12 changes: 7 additions & 5 deletions lib/internal/print_help.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const { types } = internalBinding('options');
const hasCrypto = Boolean(process.versions.openssl);

const typeLookup = [];
for (const key of Object.keys(types))
Expand Down Expand Up @@ -33,11 +34,6 @@ const envVars = new Map([
'certificate validation' }],
['NODE_V8_COVERAGE', { helpText: 'directory to output v8 coverage JSON ' +
'to' }],
['OPENSSL_CONF', { helpText: 'load OpenSSL configuration from file' }],
['SSL_CERT_DIR', { helpText: 'sets OpenSSL\'s directory of trusted ' +
'certificates when used in conjunction with --use-openssl-ca' }],
['SSL_CERT_FILE', { helpText: 'sets OpenSSL\'s trusted certificate file ' +
'when used in conjunction with --use-openssl-ca' }],
['UV_THREADPOOL_SIZE', { helpText: 'sets the number of threads used in ' +
'libuv\'s threadpool' }]
].concat(hasIntl ? [
Expand All @@ -46,6 +42,12 @@ const envVars = new Map([
] : []).concat(hasNodeOptions ? [
['NODE_OPTIONS', { helpText: 'set CLI options in the environment via a ' +
'space-separated list' }]
] : []).concat(hasCrypto ? [
['OPENSSL_CONF', { helpText: 'load OpenSSL configuration from file' }],
['SSL_CERT_DIR', { helpText: 'sets OpenSSL\'s directory of trusted ' +
'certificates when used in conjunction with --use-openssl-ca' }],
['SSL_CERT_FILE', { helpText: 'sets OpenSSL\'s trusted certificate file ' +
'when used in conjunction with --use-openssl-ca' }],
] : []));


Expand Down