mirror of https://github.com/lukechilds/node.git
Browse Source
The --use-bundled-ca and --use-openssl-ca command line arguments are mutually exclusive but can both be used on the same command line. This commit adds a check if both options are used. Fixes: https://github.com/nodejs/node/issues/12083 PR-URL: https://github.com/nodejs/node/pull/12087 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>v6
Daniel Bevenius
8 years ago
2 changed files with 45 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||
'use strict'; |
|||
// This test checks the usage of --use-bundled-ca and --use-openssl-ca arguments
|
|||
// to verify that both are not used at the same time.
|
|||
const common = require('../common'); |
|||
if (!common.hasCrypto) { |
|||
common.skip('missing crypto'); |
|||
return; |
|||
} |
|||
const assert = require('assert'); |
|||
const os = require('os'); |
|||
const childProcess = require('child_process'); |
|||
const result = childProcess.spawnSync(process.execPath, [ |
|||
'--use-bundled-ca', |
|||
'--use-openssl-ca', |
|||
'-p', 'process.version'], |
|||
{encoding: 'utf8'}); |
|||
|
|||
assert.strictEqual(result.stderr, |
|||
process.execPath + ': either --use-openssl-ca or ' + |
|||
'--use-bundled-ca can be used, not both' + os.EOL); |
|||
assert.strictEqual(result.status, 9); |
|||
|
|||
const useBundledCA = childProcess.spawnSync(process.execPath, [ |
|||
'--use-bundled-ca', |
|||
'-p', 'process.version']); |
|||
assert.strictEqual(useBundledCA.status, 0); |
|||
|
|||
const useOpenSSLCA = childProcess.spawnSync(process.execPath, [ |
|||
'--use-openssl-ca', |
|||
'-p', 'process.version']); |
|||
assert.strictEqual(useOpenSSLCA.status, 0); |
Loading…
Reference in new issue