|
@ -27,6 +27,7 @@ var crypto = require('crypto'); |
|
|
var net = require('net'); |
|
|
var net = require('net'); |
|
|
var tls = require('tls'); |
|
|
var tls = require('tls'); |
|
|
var util = require('util'); |
|
|
var util = require('util'); |
|
|
|
|
|
var listenerCount = require('events').listenerCount; |
|
|
var common = require('_tls_common'); |
|
|
var common = require('_tls_common'); |
|
|
|
|
|
|
|
|
var Timer = process.binding('timer_wrap').Timer; |
|
|
var Timer = process.binding('timer_wrap').Timer; |
|
@ -131,7 +132,7 @@ function requestOCSP(self, hello, ctx, cb) { |
|
|
if (ctx.context) |
|
|
if (ctx.context) |
|
|
ctx = ctx.context; |
|
|
ctx = ctx.context; |
|
|
|
|
|
|
|
|
if (self.server.listeners('OCSPRequest').length === 0) { |
|
|
if (listenerCount(self.server, 'OCSPRequest') === 0) { |
|
|
return cb(null); |
|
|
return cb(null); |
|
|
} else { |
|
|
} else { |
|
|
self.server.emit('OCSPRequest', |
|
|
self.server.emit('OCSPRequest', |
|
@ -311,9 +312,9 @@ TLSSocket.prototype._init = function(socket) { |
|
|
this.ssl.handshakes = 0; |
|
|
this.ssl.handshakes = 0; |
|
|
|
|
|
|
|
|
if (this.server && |
|
|
if (this.server && |
|
|
(this.server.listeners('resumeSession').length > 0 || |
|
|
(listenerCount(this.server, 'resumeSession') > 0 || |
|
|
this.server.listeners('newSession').length > 0 || |
|
|
listenerCount(this.server, 'newSession') > 0 || |
|
|
this.server.listeners('OCSPRequest').length > 0)) { |
|
|
listenerCount(this.server, 'OCSPRequest') > 0)) { |
|
|
this.ssl.enableSessionCallbacks(); |
|
|
this.ssl.enableSessionCallbacks(); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|