diff options
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r-- | lib/_tls_wrap.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 530a41a1e8..4379287cc4 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -37,6 +37,7 @@ assertCrypto(); const { setImmediate } = require('timers'); const assert = require('internal/assert'); const crypto = require('crypto'); +const EE = require('events'); const net = require('net'); const tls = require('tls'); const common = require('_tls_common'); @@ -1284,6 +1285,19 @@ Server.prototype.addContext = function(servername, context) { this._contexts.push([re, tls.createSecureContext(context).context]); }; +Server.prototype[EE.captureRejectionSymbol] = function( + err, event, sock) { + + switch (event) { + case 'secureConnection': + sock.destroy(err); + break; + default: + net.Server.prototype[Symbol.for('nodejs.rejection')] + .call(this, err, event, sock); + } +}; + function SNICallback(servername, callback) { const contexts = this.server._contexts; |