diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-04-27 09:39:48 +0200 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2015-04-30 11:02:30 +0200 |
commit | 178741637693a95f9e81200b486df2e6aee06986 (patch) | |
tree | be7fe6a983369a6baa95c96808dcabab7a0ddd80 /lib/_tls_wrap.js | |
parent | 2684c902c4ff90711e57e787c5bfe0bac33bcd49 (diff) | |
download | node-new-178741637693a95f9e81200b486df2e6aee06986.tar.gz |
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 <ohtsu@iij.ad.jp>
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r-- | lib/_tls_wrap.js | 4 |
1 files changed, 3 insertions, 1 deletions
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) { |