From 178741637693a95f9e81200b486df2e6aee06986 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Mon, 27 Apr 2015 09:39:48 +0200 Subject: tls: destroy singleUse context immediately Destroy singleUse context right after it is going out of use. Fix: https://github.com/iojs/io.js/issues/1522 PR-URL: https://github.com/iojs/io.js/pull/1529 Reviewed-By: Shigeki Ohtsu --- lib/_tls_wrap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/_tls_wrap.js') diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 7f83e2f759..122c7042a4 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -301,7 +301,9 @@ TLSSocket.prototype._wrapHandle = function(handle) { }; TLSSocket.prototype._destroySSL = function _destroySSL() { - return this.ssl.destroySSL(); + this.ssl.destroySSL(); + if (this.ssl._secureContext.singleUse) + this.ssl._secureContext.context.close(); }; TLSSocket.prototype._init = function(socket, wrap) { -- cgit v1.2.1