We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4ad5d7 commit 7fa24d6Copy full SHA for 7fa24d6
lib/_tls_wrap.js
@@ -289,15 +289,22 @@ TLSSocket.prototype._wrapHandle = function(handle) {
289
}
290
});
291
292
- this.on('close', this._destroySSL);
+ this.on('close', function() {
293
+ this._destroySSL();
294
+ res = null;
295
+ });
296
297
return res;
298
};
299
300
TLSSocket.prototype._destroySSL = function _destroySSL() {
301
+ if (!this.ssl) return;
302
this.ssl.destroySSL();
- if (this.ssl._secureContext.singleUse)
303
+ if (this.ssl._secureContext.singleUse) {
304
this.ssl._secureContext.context.close();
305
+ delete this.ssl._secureContext.context;
306
+ }
307
+ delete this.ssl;
308
309
310
TLSSocket.prototype._init = function(socket, wrap) {
0 commit comments