summaryrefslogtreecommitdiff
path: root/lib/_tls_common.js
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2014-06-25 14:47:59 +0400
committerFedor Indutny <fedor@indutny.com>2014-06-25 14:47:59 +0400
commitc147e81091750ed38500d75299be3d9ced04d946 (patch)
tree893751783433fb2e49ca4ff64a2496f167f870f1 /lib/_tls_common.js
parente50749bb056d84763b89b9f96a584592ab262c55 (diff)
downloadandroid-node-v8-c147e81091750ed38500d75299be3d9ced04d946.tar.gz
android-node-v8-c147e81091750ed38500d75299be3d9ced04d946.tar.bz2
android-node-v8-c147e81091750ed38500d75299be3d9ced04d946.zip
crypto: add `honorCipherOrder` argument
Add `honorCipherOrder` argument to `crypto.createCredentials`. fix #7249
Diffstat (limited to 'lib/_tls_common.js')
-rw-r--r--lib/_tls_common.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/_tls_common.js b/lib/_tls_common.js
index df2c70cf7b..72128496e7 100644
--- a/lib/_tls_common.js
+++ b/lib/_tls_common.js
@@ -20,6 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var util = require('util');
+var constants = require('constants');
var tls = require('tls');
// Lazily loaded
@@ -54,9 +55,11 @@ exports.SecureContext = SecureContext;
exports.createSecureContext = function createSecureContext(options, context) {
if (!options) options = {};
- var c = new SecureContext(options.secureProtocol,
- options.secureOptions,
- context);
+ var secureOptions = options.secureOptions;
+ if (options.honorCipherOrder)
+ secureOptions |= constants.SSL_OP_CIPHER_SERVER_PREFERENCE;
+
+ var c = new SecureContext(options.secureProtocol, secureOptions, context);
if (context) return c;