Skip to content

Commit 427c4d7

Browse files
danbevBridgeAR
authored andcommitted
test: set clientOpts.port property
Currently this test will overwrite the clientOpts object with the port, instead of setting the port property on the clientOpts object which looks like the original intent. Doing this the test fails reporting that the fake-cnnic-root-cert has expired. This is indeed true: $ openssl x509 -in test/fixtures/keys/fake-cnnic-root-cert.pem \ -text -noout Certificate: ... Validity Not Before: Jun 9 17:15:16 2015 GMT Not After : Mar 29 17:15:16 2018 GMT This commit sets the errorCode to CERT_HAS_EXPIRED. I tried updating the certificate using test/fixtures/keys/Makefile but then no error is thrown and I'm currently looking into this. PR-URL: nodejs#19767 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 541eccc commit 427c4d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-tls-cnnic-whitelist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const testCases = [
2828
rejectUnauthorized: true,
2929
ca: [loadPEM('fake-cnnic-root-cert')]
3030
},
31-
errorCode: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
31+
errorCode: 'CERT_HAS_EXPIRED'
3232
},
3333
// Test 1: for the fix of node#2061
3434
// agent6-cert.pem is signed by intermediate cert of ca3.
@@ -58,7 +58,7 @@ function runTest(tindex) {
5858
const server = tls.createServer(tcase.serverOpts, (s) => {
5959
s.resume();
6060
}).listen(0, common.mustCall(function() {
61-
tcase.clientOpts = this.address().port;
61+
tcase.clientOpts.port = this.address().port;
6262
const client = tls.connect(tcase.clientOpts);
6363
client.on('error', common.mustCall((e) => {
6464
assert.strictEqual(e.code, tcase.errorCode);

0 commit comments

Comments
 (0)