Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 73e7811

Browse filesBrowse files
evanlucasMyles Borins
authored andcommitted
test: add test for tls.parseCertString
It does not currently have any explicit tests to verify the behavior. PR-URL: #4283 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 61f91b2 commit 73e7811
Copy full SHA for 73e7811

File tree

Expand file treeCollapse file tree

1 file changed

+26
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+26
-0
lines changed
Open diff view settings
Collapse file
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const tls = require('tls');
6+
7+
const singles = 'C=US\nST=CA\nL=SF\nO=Node.js Foundation\nOU=Node.js\nCN=ca1\n'
8+
+ 'emailAddress=ry@clouds.org';
9+
const singlesOut = tls.parseCertString(singles);
10+
assert.deepEqual(singlesOut, {
11+
C: 'US',
12+
ST: 'CA',
13+
L: 'SF',
14+
O: 'Node.js Foundation',
15+
OU: 'Node.js',
16+
CN: 'ca1',
17+
emailAddress: 'ry@clouds.org'
18+
});
19+
20+
const doubles = 'OU=Domain Control Validated\nOU=PositiveSSL Wildcard\n' +
21+
'CN=*.nodejs.org';
22+
const doublesOut = tls.parseCertString(doubles);
23+
assert.deepEqual(doublesOut, {
24+
OU: [ 'Domain Control Validated', 'PositiveSSL Wildcard' ],
25+
CN: '*.nodejs.org'
26+
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.