allow setting of ciphers in credentials
authorTheo Schlossnagle <jesus@omniti.com>
Tue, 5 Apr 2011 03:27:20 +0000 (23:27 -0400)
committerRyan Dahl <ry@tinyclouds.org>
Thu, 14 Apr 2011 01:35:39 +0000 (18:35 -0700)
fixes #873

lib/crypto.js
lib/tls.js

index cbe3e9251e4045b056c0b6755cb29dabee944835..6931fbcc35693ed7174d2181eb32a0820fc04630 100644 (file)
@@ -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++) {
index 4ed12853d9336d940b64193ce8f8980b86e31a9f..d4599aba383e1d188ed1c4cf6b84e992b3018cb0 100644 (file)
@@ -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;
 };