Skip to content

Commit 3df8633

Browse files
danbevrvagg
authored andcommitted
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. PR-URL: #24556 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 5a47c2e commit 3df8633

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/internal/print_help.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

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

56
const typeLookup = [];
67
for (const key of Object.keys(types))
@@ -33,11 +34,6 @@ const envVars = new Map([
3334
'certificate validation' }],
3435
['NODE_V8_COVERAGE', { helpText: 'directory to output v8 coverage JSON ' +
3536
'to' }],
36-
['OPENSSL_CONF', { helpText: 'load OpenSSL configuration from file' }],
37-
['SSL_CERT_DIR', { helpText: 'sets OpenSSL\'s directory of trusted ' +
38-
'certificates when used in conjunction with --use-openssl-ca' }],
39-
['SSL_CERT_FILE', { helpText: 'sets OpenSSL\'s trusted certificate file ' +
40-
'when used in conjunction with --use-openssl-ca' }],
4137
['UV_THREADPOOL_SIZE', { helpText: 'sets the number of threads used in ' +
4238
'libuv\'s threadpool' }]
4339
].concat(hasIntl ? [
@@ -46,6 +42,12 @@ const envVars = new Map([
4642
] : []).concat(hasNodeOptions ? [
4743
['NODE_OPTIONS', { helpText: 'set CLI options in the environment via a ' +
4844
'space-separated list' }]
45+
] : []).concat(hasCrypto ? [
46+
['OPENSSL_CONF', { helpText: 'load OpenSSL configuration from file' }],
47+
['SSL_CERT_DIR', { helpText: 'sets OpenSSL\'s directory of trusted ' +
48+
'certificates when used in conjunction with --use-openssl-ca' }],
49+
['SSL_CERT_FILE', { helpText: 'sets OpenSSL\'s trusted certificate file ' +
50+
'when used in conjunction with --use-openssl-ca' }],
4951
] : []));
5052

5153

0 commit comments

Comments
 (0)