Skip to content

Commit ccefef2

Browse files
danbevBethGriggs
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 <luigipinca@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 546f941 commit ccefef2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎lib/internal/print_help.js‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

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

56
consttypeLookup=[];
67
for(constkeyofObject.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)