diff --git a/test/parallel/test-tls-set-sigalgs.js b/test/parallel/test-tls-set-sigalgs.js index 59dc2ca0c786cf..ffe950a0d21f86 100644 --- a/test/parallel/test-tls-set-sigalgs.js +++ b/test/parallel/test-tls-set-sigalgs.js @@ -9,13 +9,6 @@ const { assert, connect, keys } = require(fixtures.path('tls-connect')); -function assert_arrays_equal(left, right) { - assert.strictEqual(left.length, right.length); - for (let i = 0; i < left.length; i++) { - assert.strictEqual(left[i], right[i]); - } -} - function test(csigalgs, ssigalgs, shared_sigalgs, cerr, serr) { assert(shared_sigalgs || serr || cerr, 'test missing any expectations'); connect({ @@ -43,16 +36,19 @@ function test(csigalgs, ssigalgs, shared_sigalgs, cerr, serr) { assert.ifError(pair.client.err); assert(pair.server.conn); assert(pair.client.conn); - assert_arrays_equal(pair.server.conn.getSharedSigalgs(), shared_sigalgs); + assert.deepStrictEqual( + pair.server.conn.getSharedSigalgs(), + shared_sigalgs + ); } else { if (serr) { assert(pair.server.err); - assert(pair.server.err.code, serr); + assert.strictEqual(pair.server.err.code, serr); } if (cerr) { assert(pair.client.err); - assert(pair.client.err.code, cerr); + assert.strictEqual(pair.client.err.code, cerr); } } @@ -68,7 +64,9 @@ test('RSA-PSS+SHA256:RSA-PSS+SHA512:ECDSA+SHA256', // Do not have shared sigalgs. test('RSA-PSS+SHA384', 'ECDSA+SHA256', - undefined, 'ECONNRESET', 'ERR_SSL_NO_SHARED_SIGNATURE_ALGORITMS'); + undefined, 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE', + 'ERR_SSL_NO_SHARED_SIGNATURE_ALGORITHMS'); test('RSA-PSS+SHA384:ECDSA+SHA256', 'ECDSA+SHA384:RSA-PSS+SHA256', - undefined, 'ECONNRESET', 'ERR_SSL_NO_SHARED_SIGNATURE_ALGORITMS'); + undefined, 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE', + 'ERR_SSL_NO_SHARED_SIGNATURE_ALGORITHMS');