Merge remote-tracking branch 'ry/v0.10'
[platform/upstream/nodejs.git] / lib / tls.js
index 5385912..f0cdaac 100644 (file)
@@ -992,6 +992,7 @@ SecurePair.prototype.error = function(returnOnly) {
 // - key. string.
 // - cert: string.
 // - ca: string or array of strings.
+// - sessionTimeout: integer.
 //
 // emit 'secureConnection'
 //   function (cleartextStream, encryptedStream) { }
@@ -1060,6 +1061,10 @@ function Server(/* [options], listener */) {
     throw new TypeError('handshakeTimeout must be a number');
   }
 
+  if (self.sessionTimeout) {
+    sharedCreds.context.setSessionTimeout(self.sessionTimeout);
+  }
+
   // constructor call
   net.Server.call(this, function(socket) {
     var creds = crypto.createCredentials(null, sharedCreds.context);
@@ -1156,6 +1161,7 @@ Server.prototype.setOptions = function(options) {
   if (options.secureProtocol) this.secureProtocol = options.secureProtocol;
   if (options.crl) this.crl = options.crl;
   if (options.ciphers) this.ciphers = options.ciphers;
+  if (options.sessionTimeout) this.sessionTimeout = options.sessionTimeout;
   var secureOptions = options.secureOptions || 0;
   if (options.honorCipherOrder) {
     secureOptions |= constants.SSL_OP_CIPHER_SERVER_PREFERENCE;