You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the `pskCallback` client/server option, which resolves an identity
or identity hint to a pre-shared key.
Add the `pskIdentityHint` server option to set the identity hint for the
ServerKeyExchange message.
Co-authored-by: Chris Osborn <[email protected]>
Co-authored-by: stephank <[email protected]>
Co-authored-by: Taylor Zane Glaeser <[email protected]>
PR-URL: #23188
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
An array of strings, `Buffer`s or `TypedArray`s or `DataView`s, or a
@@ -1593,8 +1647,30 @@ changes:
1593
1647
provided the default callback with high-level API will be used (see below).
1594
1648
*`ticketKeys`: {Buffer} 48-bytes of cryptographically strong pseudo-random
1595
1649
data. See [Session Resumption][] for more information.
1650
+
*`pskCallback` {Function}
1651
+
* socket: {tls.TLSSocket} the server [`tls.TLSSocket`][] instance for
1652
+
this connection.
1653
+
* identity: {string} identity parameter sent from the client.
1654
+
* Returns: {Buffer|TypedArray|DataView} pre-shared key that must either be
1655
+
a buffer or `null` to stop the negotiation process. Returned PSK must be
1656
+
compatible with the selected cipher's digest.
1657
+
When negotiating TLS-PSK (pre-shared keys), this function is called
1658
+
with the identity provided by the client.
1659
+
If the return value is `null` the negotiation process will stop and an
1660
+
"unknown_psk_identity" alert message will be sent to the other party.
1661
+
If the server wishes to hide the fact that the PSK identity was not known,
1662
+
the callback must provide some random data as `psk` to make the connection
1663
+
fail with "decrypt_error" before negotiation is finished.
1664
+
PSK ciphers are disabled by default, and using TLS-PSK thus
1665
+
requires explicitly specifying a cipher suite with the `ciphers` option.
1666
+
More information can be found in the [RFC 4279][].
1667
+
*`pskIdentityHint` {string} optional hint to send to a client to help
1668
+
with selecting the identity during TLS-PSK negotiation. Will be ignored
1669
+
in TLS 1.3. Upon failing to set pskIdentityHint `'tlsClientError'` will be
1670
+
emitted with `'ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED'` code.
1596
1671
* ...: Any [`tls.createSecureContext()`][] option can be provided. For
1597
-
servers, the identity options (`pfx` or `key`/`cert`) are usually required.
1672
+
servers, the identity options (`pfx`, `key`/`cert` or `pskCallback`)
1673
+
are usually required.
1598
1674
* ...: Any [`net.createServer()`][] option can be provided.
1599
1675
*`secureConnectionListener` {Function}
1600
1676
* Returns: {tls.Server}
@@ -1870,3 +1946,5 @@ where `secureSocket` has the same API as `pair.cleartext`.
1870
1946
[cipher list format]: https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT
1871
1947
[modifying the default cipher suite]: #tls_modifying_the_default_tls_cipher_suite
0 commit comments