Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

tls: Destroy socket when encrypted side closes #5170

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/tls.js
Expand Up @@ -1322,6 +1322,12 @@ function pipe(pair, socket) {
pair.encrypted.pipe(socket);
socket.pipe(pair.encrypted);

pair.encrypted.on('close', function() {
process.nextTick(function() {
socket.destroy();
});
});

pair.fd = socket.fd;
var cleartext = pair.cleartext;
cleartext.socket = socket;
Expand Down