tls: destroy TLS socket if StreamWrap is destroyed
Previously, there was no mechanism in place that would have destroyed the TLS socket once the underlying socket had been closed. PR-URL: https://github.com/nodejs/node/pull/24290 Refs: https://github.com/nodejs/node/pull/24288 Refs: https://github.com/nodejs/node/pull/24075 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
This commit is contained in:
parent
cbbf64e40e
commit
b92d55f718
@ -310,10 +310,12 @@ function TLSSocket(socket, opts) {
|
||||
|
||||
// Wrap plain JS Stream into StreamWrap
|
||||
var wrap;
|
||||
if ((socket instanceof net.Socket && socket._handle) || !socket)
|
||||
if ((socket instanceof net.Socket && socket._handle) || !socket) {
|
||||
wrap = socket;
|
||||
else
|
||||
} else {
|
||||
wrap = new StreamWrap(socket);
|
||||
wrap.once('close', () => this.destroy());
|
||||
}
|
||||
|
||||
// Just a documented property to make secure sockets
|
||||
// distinguishable from regular ones.
|
||||
|
Loading…
x
Reference in New Issue
Block a user