diff --git a/doc/api/errors.md b/doc/api/errors.md
index ed4bfacf1cd57b..a7726cd03019cd 100644
--- a/doc/api/errors.md
+++ b/doc/api/errors.md
@@ -1858,6 +1858,15 @@ added: v13.3.0
The context must be a `SecureContext`.
+
+### `ERR_TLS_INVALID_STATE`
+
+
+The TLS socket must be connected and securily established. Ensure the 'secure'
+event is emitted, before you continue.
+
### `ERR_TLS_INVALID_PROTOCOL_METHOD`
diff --git a/doc/api/tls.md b/doc/api/tls.md
index fee6e33d610581..3341e6e9ea514b 100644
--- a/doc/api/tls.md
+++ b/doc/api/tls.md
@@ -1094,6 +1094,39 @@ See
[SSL_get_shared_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html)
for more information.
+### `tlsSocket.exportKeyingMaterial(length, label[, context])`
+
+
+* `length` {number} number of bytes to retrieve from keying material
+* `label` {string} an application specific label, typically this will be a
+value from the
+[IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).
+* `context` {Buffer} Optionally provide a context.
+
+* Returns: {Buffer} requested bytes of the keying material
+
+Keying material is used for validations to prevent different kind of attacks in
+network protocols, for example in the specifications of IEEE 802.1X.
+
+Example
+
+```js
+const keyingMaterial = tlsSocket.exportKeyingMaterial(
+ 128,
+ 'client finished');
+
+/**
+ Example return value of keyingMaterial:
+
+*/
+```
+See the OpenSSL [`SSL_export_keying_material`][] documentation for more
+information.
+
### `tlsSocket.getTLSTicket()`