Skip to content

Commit af78840

Browse files
Hativtniessen
authored andcommitted
tls: set ecdhCurve default to 'auto'
For best out-of-the-box compatibility there should not be one default `ecdhCurve` for the tls client, OpenSSL should choose them automatically. See https://wiki.openssl.org/index.php/Manual:SSL_CTX_set1_curves(3) PR-URL: #16853 Refs: #16196 Refs: #1495 Refs: #15206 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 04566d3 commit af78840

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

doc/api/tls.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1164,8 +1164,7 @@ added: v0.11.13
11641164
-->
11651165

11661166
The default curve name to use for ECDH key agreement in a tls server. The
1167-
default value is `'prime256v1'` (NIST P-256). Consult [RFC 4492] and
1168-
[FIPS.186-4] for more details.
1167+
default value is `'auto'`. See [`tls.createSecureContext()`] for further information.
11691168

11701169

11711170
## Deprecated APIs
@@ -1296,13 +1295,11 @@ where `secure_socket` has the same API as `pair.cleartext`.
12961295
[Chrome's 'modern cryptography' setting]: https://www.chromium.org/Home/chromium-security/education/tls#TOC-Cipher-Suites
12971296
[DHE]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange
12981297
[ECDHE]: https://en.wikipedia.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman
1299-
[FIPS.186-4]: http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
13001298
[Forward secrecy]: https://en.wikipedia.org/wiki/Perfect_forward_secrecy
13011299
[OCSP request]: https://en.wikipedia.org/wiki/OCSP_stapling
13021300
[OpenSSL Options]: crypto.html#crypto_openssl_options
13031301
[OpenSSL cipher list format documentation]: https://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER-LIST-FORMAT
13041302
[Perfect Forward Secrecy]: #tls_perfect_forward_secrecy
1305-
[RFC 4492]: https://www.rfc-editor.org/rfc/rfc4492.txt
13061303
[SSL_CTX_set_timeout]: https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_timeout.html
13071304
[SSL_METHODS]: https://www.openssl.org/docs/man1.0.2/ssl/ssl.html#DEALING-WITH-PROTOCOL-METHODS
13081305
[Stream]: stream.html#stream_stream

lib/tls.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ exports.SLAB_BUFFER_SIZE = 10 * 1024 * 1024;
4545
exports.DEFAULT_CIPHERS =
4646
process.binding('constants').crypto.defaultCipherList;
4747

48-
exports.DEFAULT_ECDH_CURVE = 'prime256v1';
48+
exports.DEFAULT_ECDH_CURVE = 'auto';
4949

5050
exports.getCiphers = internalUtil.cachedResult(
5151
() => internalUtil.filterDuplicateStrings(binding.getSSLCiphers(), true)

test/parallel/test-tls-client-getephemeralkeyinfo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function testDHE2048() {
8080
}
8181

8282
function testECDHE256() {
83-
test(256, 'ECDH', tls.DEFAULT_ECDH_CURVE, testECDHE512);
83+
test(256, 'ECDH', 'prime256v1', testECDHE512);
8484
ntests++;
8585
}
8686

0 commit comments

Comments
 (0)