diff --git a/doc/api/tls.md b/doc/api/tls.md index 942733df8cc7..644c09759025 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1271,8 +1271,9 @@ added: v5.0.0 Returns an object describing ephemeral key agreement in [perfect forward secrecy][] on a client connection. It returns an empty object when the key agreement is not ephemeral. As this is only supported on a client socket; -`null` is returned if called on a server socket. The supported types are `'DH'`, -`'ECDH'`, and `'TLSGroup'`. For `'DH'` and `'ECDH'`, the object describes peer +`null` is returned if called on a server socket. Use +[`tlsSocket.getNegotiatedGroup()`][] to get the negotiated group on a server +socket. The supported types are `'DH'`, `'ECDH'`, and `'TLSGroup'`. For `'DH'` and `'ECDH'`, the object describes peer temporary key parameters. For `'TLSGroup'`, the object identifies the negotiated TLS Supported Group used for key agreement when a peer temporary key object is not available. @@ -1302,6 +1303,23 @@ provided by SSL/TLS is not desired or is not enough. Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used to implement the `tls-unique` channel binding from [RFC 5929][]. +### `tlsSocket.getNegotiatedGroup()` + + + +* Returns: {string|undefined} The name of the TLS group used for key + agreement, or `undefined` if no group was negotiated. + +Returns the TLS Supported Group negotiated for key agreement, for example +`'X25519MLKEM768'`, `'x25519'`, or `'secp256r1'`. Unlike +[`tlsSocket.getEphemeralKeyInfo()`][], this method works on both client and +server sockets. `undefined` is returned when the key agreement does not use a +group, such as with TLSv1.2 RSA key exchange, or before the handshake has +completed. With TLSv1.2 DHE key exchange, only the server socket reports the +group. + ### `tlsSocket.getPeerCertificate([detailed])`