@@ -123,23 +123,17 @@ all sessions). Methods implementing this technique are called "ephemeral".
123123Currently two methods are commonly used to achieve perfect forward secrecy (note
124124the character "E" appended to the traditional abbreviations):
125125
126- * [ DHE] [ ] : An ephemeral version of the Diffie-Hellman key-agreement protocol.
127126* [ ECDHE] [ ] : An ephemeral version of the Elliptic Curve Diffie-Hellman
128127 key-agreement protocol.
128+ * [ DHE] [ ] : An ephemeral version of the Diffie-Hellman key-agreement protocol.
129129
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.
138133
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.
143137
144138Perfect forward secrecy was optional up to TLSv1.2. As of TLSv1.3, (EC)DHE is
145139always used (with the exception of PSK-only connections).
@@ -1796,6 +1790,10 @@ argument.
17961790<!-- YAML
17971791added: v0.11.13
17981792changes:
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.
17991797 - version: v12.12.0
18001798 pr-url: https://github.com/nodejs/node/pull/28973
18011799 description: Added `privateKeyIdentifier` and `privateKeyEngine` options
@@ -1880,13 +1878,10 @@ changes:
18801878 client certificate.
18811879 * ` crl ` {string|string\[ ] |Buffer|Buffer\[ ] } PEM formatted CRLs (Certificate
18821880 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.
18901885 * ` ecdhCurve ` {string} A string describing a named curve or a colon separated
18911886 list of curve NIDs or names, for example ` P-521:P-384:P-256 ` , to use for
18921887 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
19731968If the ` ca ` option is not given, then Node.js will default to using
19741969[ Mozilla's publicly trusted list of CAs] [ ] .
19751970
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+
19761978## ` tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) `
19771979
19781980<!-- YAML
0 commit comments