diff options
author | David Benjamin <davidben@google.com> | 2017-10-21 13:29:18 -0400 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2017-11-11 20:42:50 +1100 |
commit | 560f79777606363a6d31896e0fe5744a45302ff5 (patch) | |
tree | d9c068162efef05105f6efa52c1feaf7bfa63cbc /lib | |
parent | aa81f995b4bcbdc4bfb40b72e31058d40f5b7f3a (diff) | |
download | android-node-v8-560f79777606363a6d31896e0fe5744a45302ff5.tar.gz android-node-v8-560f79777606363a6d31896e0fe5744a45302ff5.tar.bz2 android-node-v8-560f79777606363a6d31896e0fe5744a45302ff5.zip |
crypto: deprecate {ecdhCurve: false}
This doesn't work in OpenSSL 1.1.0. Per discussion on the PR, it is
preferable to just deprecate this setting. Deprecate it and skip the
test in OpenSSL 1.1.0.
PR-URL: https://github.com/nodejs/node/pull/16130
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_tls_common.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 4196cc084c..75eb6a2ec5 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -65,6 +65,16 @@ function validateKeyCert(value, type) { exports.SecureContext = SecureContext; +function ecdhCurveWarning() { + if (ecdhCurveWarning.emitted) return; + process.emitWarning('{ ecdhCurve: false } is deprecated.', + 'DeprecationWarning', + 'DEP0083'); + ecdhCurveWarning.emitted = true; +} +ecdhCurveWarning.emitted = false; + + exports.createSecureContext = function createSecureContext(options, context) { if (!options) options = {}; @@ -140,6 +150,8 @@ exports.createSecureContext = function createSecureContext(options, context) { c.context.setECDHCurve(tls.DEFAULT_ECDH_CURVE); else if (options.ecdhCurve) c.context.setECDHCurve(options.ecdhCurve); + else + ecdhCurveWarning(); if (options.dhparam) { const warning = c.context.setDHParam(options.dhparam); |