Skip to content

Commit

Permalink
test: fix tls-multi-key race condition
Browse files Browse the repository at this point in the history
In some conditions it can happen that the client-side socket is
destroyed before the server-side socket has gracefully closed, thus
causing a 'ECONNRESET' error in this socket. To solve this, also close
gracefully in the client side.

PR-URL: #3966
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
santigimeno authored and Myles Borins committed Feb 11, 2016
1 parent 6499012 commit ab95f93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-tls-multi-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ var server = tls.createServer(options, function(conn) {
rejectUnauthorized: false
}, function() {
ciphers.push(rsa.getCipher());
ecdsa.destroy();
rsa.destroy();
ecdsa.end();
rsa.end();
server.close();
});
});
Expand Down

0 comments on commit ab95f93

Please sign in to comment.