@@ -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).
@@ -1798,6 +1792,10 @@ argument.
17981792<!-- YAML
17991793added: v0.11.13
18001794changes:
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.
18011799 - version: v12.12.0
18021800 pr-url: https://github.com/nodejs/node/pull/28973
18031801 description: Added `privateKeyIdentifier` and `privateKeyEngine` options
@@ -1882,13 +1880,10 @@ changes:
18821880 client certificate.
18831881 * ` crl ` {string|string\[ ] |Buffer|Buffer\[ ] } PEM formatted CRLs (Certificate
18841882 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.
18921887 * ` ecdhCurve ` {string} A string describing a named curve or a colon separated
18931888 list of curve NIDs or names, for example ` P-521:P-384:P-256 ` , to use for
18941889 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
19751970If the ` ca ` option is not given, then Node.js will default to using
19761971[ Mozilla's publicly trusted list of CAs] [ ] .
19771972
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+
19781980## ` tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) `
19791981
19801982<!-- YAML
0 commit comments