Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2014-03-07 03:27:01 +0400
committerFedor Indutny <fedor@indutny.com>2014-03-29 12:01:43 +0400
commit5d2aef17ee56fbbf415ca1e3034cdb02cd97117c (patch)
tree4cdf828ffa9b6a3c33ff864539ed8afa83437a69 /lib/tls.js
parentb55c9d68aa713e75ff5077cd425cbaafde010b92 (diff)
crypto: move `createCredentials` to tls
Move `createCredentials` to `tls` module and rename it to `createSecureContext`. Make it use default values from `tls` module: `DEFAULT_CIPHERS` and `DEFAULT_ECDH_CURVE`. fix #7249
Diffstat (limited to 'lib/tls.js')
-rw-r--r--lib/tls.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/tls.js b/lib/tls.js
index 3004c32d2b4..197e968e08b 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -23,12 +23,6 @@ var net = require('net');
var url = require('url');
var util = require('util');
-exports.DEFAULT_CIPHERS =
- 'ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:' + // TLS 1.2
- 'RC4:HIGH:!MD5:!aNULL:!EDH'; // TLS 1.0
-
-exports.DEFAULT_ECDH_CURVE = 'prime256v1';
-
// Allow {CLIENT_RENEG_LIMIT} client-initiated session renegotiations
// every {CLIENT_RENEG_WINDOW} seconds. An error event is emitted if more
// renegotations are seen. The settings are applied to all remote client
@@ -38,6 +32,12 @@ exports.CLIENT_RENEG_WINDOW = 600;
exports.SLAB_BUFFER_SIZE = 10 * 1024 * 1024;
+exports.DEFAULT_CIPHERS =
+ 'ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:' + // TLS 1.2
+ 'RC4:HIGH:!MD5:!aNULL:!EDH'; // TLS 1.0
+
+exports.DEFAULT_ECDH_CURVE = 'prime256v1';
+
exports.getCiphers = function() {
var names = process.binding('crypto').getSSLCiphers();
// Drop all-caps names in favor of their lowercase aliases,
@@ -209,6 +209,8 @@ exports.parseCertString = function parseCertString(s) {
};
// Public API
+exports.createSecureContext = require('_tls_common').createSecureContext;
+exports.SecureContext = require('_tls_common').SecureContext;
exports.TLSSocket = require('_tls_wrap').TLSSocket;
exports.Server = require('_tls_wrap').Server;
exports.createServer = require('_tls_wrap').createServer;