Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 912ac36

Browse files
danbevMylesBorins
authored andcommittedJun 14, 2018
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. Backport-PR-URL: #20776 PR-URL: #19767 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent da34021 commit 912ac36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

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

+2-2
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)
Please sign in to comment.