mirror of
https://github.com/zebrajr/node.git
synced 2025-12-07 00:20:38 +01:00
* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
39 lines
971 B
JavaScript
39 lines
971 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const tls = require('tls');
|
|
|
|
{
|
|
const singles = 'C=US\nST=CA\nL=SF\nO=Node.js Foundation\nOU=Node.js\n' +
|
|
'CN=ca1\nemailAddress=ry@clouds.org';
|
|
const singlesOut = tls.parseCertString(singles);
|
|
assert.deepStrictEqual(singlesOut, {
|
|
C: 'US',
|
|
ST: 'CA',
|
|
L: 'SF',
|
|
O: 'Node.js Foundation',
|
|
OU: 'Node.js',
|
|
CN: 'ca1',
|
|
emailAddress: 'ry@clouds.org'
|
|
});
|
|
}
|
|
|
|
{
|
|
const doubles = 'OU=Domain Control Validated\nOU=PositiveSSL Wildcard\n' +
|
|
'CN=*.nodejs.org';
|
|
const doublesOut = tls.parseCertString(doubles);
|
|
assert.deepStrictEqual(doublesOut, {
|
|
OU: [ 'Domain Control Validated', 'PositiveSSL Wildcard' ],
|
|
CN: '*.nodejs.org'
|
|
});
|
|
}
|
|
|
|
{
|
|
const invalid = 'fhqwhgads';
|
|
const invalidOut = tls.parseCertString(invalid);
|
|
assert.deepStrictEqual(invalidOut, {});
|
|
}
|