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: nodejs#3966
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
santigimeno authored and Michael Scovetta committed Apr 2, 2016
1 parent 2b90c3a commit 5108f39
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 5108f39

Please sign in to comment.