@@ -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).
@@ -1796,6 +1790,10 @@ argument.
1796
1790
<!-- YAML
1797
1791
added: v0.11.13
1798
1792
changes:
1793
+ - version: REPLACEME
1794
+ pr-url: https://github.com/nodejs/node/pull/46978
1795
+ description: The `dhparam` option can now be set to `'auto'` to
1796
+ enable DHE with appropriate well-known parameters.
1799
1797
- version: v12.12.0
1800
1798
pr-url: https://github.com/nodejs/node/pull/28973
1801
1799
description: Added `privateKeyIdentifier` and `privateKeyEngine` options
@@ -1880,13 +1878,10 @@ changes:
1880
1878
client certificate.
1881
1879
* ` crl ` {string|string\[ ] |Buffer|Buffer\[ ] } PEM formatted CRLs (Certificate
1882
1880
Revocation Lists).
1883
- * ` dhparam ` {string|Buffer} Diffie-Hellman parameters, required for non-ECDHE
1884
- [ perfect forward secrecy] [ ] . Use ` openssl dhparam ` to create the parameters.
1885
- The key length must be greater than or equal to 1024 bits or else an error
1886
- will be thrown. Although 1024 bits is permissible, use 2048 bits or larger
1887
- for stronger security. If omitted or invalid, the parameters are silently
1888
- discarded and DHE ciphers will not be available. [ ECDHE] [ ] -based [ perfect
1889
- forward secrecy] [ ] will still be available.
1881
+ * ` dhparam ` {string|Buffer} ` 'auto' ` or custom Diffie-Hellman parameters,
1882
+ required for non-ECDHE [ perfect forward secrecy] [ ] . If omitted or invalid,
1883
+ the parameters are silently discarded and DHE ciphers will not be available.
1884
+ [ ECDHE] [ ] -based [ perfect forward secrecy] [ ] will still be available.
1890
1885
* ` ecdhCurve ` {string} A string describing a named curve or a colon separated
1891
1886
list of curve NIDs or names, for example ` P-521:P-384:P-256 ` , to use for
1892
1887
ECDH key agreement. Set to ` auto ` to select the
@@ -1973,6 +1968,13 @@ A key is _required_ for ciphers that use certificates. Either `key` or
1973
1968
If the ` ca ` option is not given, then Node.js will default to using
1974
1969
[ Mozilla's publicly trusted list of CAs] [ ] .
1975
1970
1971
+ Custom DHE parameters are discouraged in favor of the new ` dhparam: 'auto' `
1972
+ option. When set to ` 'auto' ` , well-known DHE parameters of sufficient strength
1973
+ will be selected automatically. Otherwise, if necessary, ` openssl dhparam ` can
1974
+ be used to create custom parameters. The key length must be greater than or
1975
+ equal to 1024 bits or else an error will be thrown. Although 1024 bits is
1976
+ permissible, use 2048 bits or larger for stronger security.
1977
+
1976
1978
## ` tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) `
1977
1979
1978
1980
<!-- YAML
0 commit comments