@@ -123,23 +123,17 @@ all sessions). Methods implementing this technique are called "ephemeral".
123
123
Currently two methods are commonly used to achieve perfect forward secrecy (note
124
124
the character "E" appended to the traditional abbreviations):
125
125
126
- * [ DHE] [ ] : An ephemeral version of the Diffie-Hellman key-agreement protocol.
127
126
* [ ECDHE] [ ] : An ephemeral version of the Elliptic Curve Diffie-Hellman
128
127
key-agreement protocol.
128
+ * [ DHE] [ ] : An ephemeral version of the Diffie-Hellman key-agreement protocol.
129
129
130
- To use perfect forward secrecy using ` DHE ` with the ` node:tls ` module, it is
131
- required to generate Diffie-Hellman parameters and specify them with the
132
- ` dhparam ` option to [ ` tls.createSecureContext() ` ] [ ] . The following illustrates
133
- the use of the OpenSSL command-line interface to generate such parameters:
134
-
135
- ``` bash
136
- openssl dhparam -outform PEM -out dhparam.pem 2048
137
- ```
130
+ Perfect forward secrecy using ECDHE is enabled by default. The ` ecdhCurve `
131
+ option can be used when creating a TLS server to customize the list of supported
132
+ ECDH curves to use. See [ ` tls.createServer() ` ] [ ] for more info.
138
133
139
- If using perfect forward secrecy using ` ECDHE ` , Diffie-Hellman parameters are
140
- not required and a default ECDHE curve will be used. The ` ecdhCurve ` property
141
- can be used when creating a TLS Server to specify the list of names of supported
142
- curves to use, see [ ` tls.createServer() ` ] [ ] for more info.
134
+ DHE is disabled by default but can be enabled alongside ECDHE by setting the
135
+ ` dhparam ` option to ` 'auto' ` . Custom DHE parameters are also supported but
136
+ discouraged in favor of automatically selected, well-known parameters.
143
137
144
138
Perfect forward secrecy was optional up to TLSv1.2. As of TLSv1.3, (EC)DHE is
145
139
always used (with the exception of PSK-only connections).
@@ -1798,6 +1792,10 @@ argument.
1798
1792
<!-- YAML
1799
1793
added: v0.11.13
1800
1794
changes:
1795
+ - version: REPLACEME
1796
+ pr-url: https://github.com/nodejs/node/pull/46978
1797
+ description: The `dhparam` option can now be set to `'auto'` to
1798
+ enable DHE with appropriate well-known parameters.
1801
1799
- version: v12.12.0
1802
1800
pr-url: https://github.com/nodejs/node/pull/28973
1803
1801
description: Added `privateKeyIdentifier` and `privateKeyEngine` options
@@ -1882,13 +1880,10 @@ changes:
1882
1880
client certificate.
1883
1881
* ` crl ` {string|string\[ ] |Buffer|Buffer\[ ] } PEM formatted CRLs (Certificate
1884
1882
Revocation Lists).
1885
- * ` dhparam ` {string|Buffer} Diffie-Hellman parameters, required for non-ECDHE
1886
- [ perfect forward secrecy] [ ] . Use ` openssl dhparam ` to create the parameters.
1887
- The key length must be greater than or equal to 1024 bits or else an error
1888
- will be thrown. Although 1024 bits is permissible, use 2048 bits or larger
1889
- for stronger security. If omitted or invalid, the parameters are silently
1890
- discarded and DHE ciphers will not be available. [ ECDHE] [ ] -based [ perfect
1891
- forward secrecy] [ ] will still be available.
1883
+ * ` dhparam ` {string|Buffer} ` 'auto' ` or custom Diffie-Hellman parameters,
1884
+ required for non-ECDHE [ perfect forward secrecy] [ ] . If omitted or invalid,
1885
+ the parameters are silently discarded and DHE ciphers will not be available.
1886
+ [ ECDHE] [ ] -based [ perfect forward secrecy] [ ] will still be available.
1892
1887
* ` ecdhCurve ` {string} A string describing a named curve or a colon separated
1893
1888
list of curve NIDs or names, for example ` P-521:P-384:P-256 ` , to use for
1894
1889
ECDH key agreement. Set to ` auto ` to select the
@@ -1975,6 +1970,13 @@ A key is _required_ for ciphers that use certificates. Either `key` or
1975
1970
If the ` ca ` option is not given, then Node.js will default to using
1976
1971
[ Mozilla's publicly trusted list of CAs] [ ] .
1977
1972
1973
+ Custom DHE parameters are discouraged in favor of the new ` dhparam: 'auto' `
1974
+ option. When set to ` 'auto' ` , well-known DHE parameters of sufficient strength
1975
+ will be selected automatically. Otherwise, if necessary, ` openssl dhparam ` can
1976
+ be used to create custom parameters. The key length must be greater than or
1977
+ equal to 1024 bits or else an error will be thrown. Although 1024 bits is
1978
+ permissible, use 2048 bits or larger for stronger security.
1979
+
1978
1980
## ` tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) `
1979
1981
1980
1982
<!-- YAML
0 commit comments