From d6f5b8a2a6d1f7f33e8638c18f736d49c94ceaaa Mon Sep 17 00:00:00 2001 From: Theo Schlossnagle Date: Mon, 4 Apr 2011 23:27:20 -0400 Subject: [PATCH] allow setting of ciphers in credentials fixes #873 --- lib/crypto.js | 2 ++ lib/tls.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/crypto.js b/lib/crypto.js index cbe3e9251e4..6931fbcc356 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -68,6 +68,8 @@ exports.createCredentials = function(options) { if (options.cert) c.context.setCert(options.cert); + if (options.ciphers) c.context.setCiphers(options.ciphers); + if (options.ca) { if (Array.isArray(options.ca)) { for (var i = 0, len = options.ca.length; i < len; i++) { diff --git a/lib/tls.js b/lib/tls.js index 4ed12853d93..d4599aba383 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -723,6 +723,7 @@ function Server(/* [options], listener */) { key: self.key, cert: self.cert, ca: self.ca, + ciphers: self.ciphers, secureProtocol: self.secureProtocol, secureOptions: self.secureOptions, crl: self.crl @@ -796,6 +797,7 @@ Server.prototype.setOptions = function(options) { if (options.ca) this.ca = options.ca; if (options.secureProtocol) this.secureProtocol = options.secureProtocol; if (options.crl) this.crl = options.crl; + if (options.ciphers) this.ciphers = options.ciphers; if (options.secureProtocol) this.secureProtocol = options.secureProtocol; if (options.secureOptions) this.secureOptions = options.secureOptions; };