@@ -904,6 +904,41 @@ added: v0.11.4
904904Always returns ` true ` . This may be used to distinguish TLS sockets from regular
905905` net.Socket ` instances.
906906
907+ ### ` tlsSocket.exportKeyingMaterial(length, label[, context]) `
908+ <!-- YAML
909+ added:
910+ - v13.10.0
911+ - v12.17.0
912+ -->
913+
914+ * ` length ` {number} number of bytes to retrieve from keying material
915+ * ` label ` {string} an application specific label, typically this will be a
916+ value from the
917+ [ IANA Exporter Label Registry] ( https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels ) .
918+ * ` context ` {Buffer} Optionally provide a context.
919+
920+ * Returns: {Buffer} requested bytes of the keying material
921+
922+ Keying material is used for validations to prevent different kind of attacks in
923+ network protocols, for example in the specifications of IEEE 802.1X.
924+
925+ Example
926+
927+ ``` js
928+ const keyingMaterial = tlsSocket .exportKeyingMaterial (
929+ 128 ,
930+ ' client finished' );
931+
932+ /**
933+ Example return value of keyingMaterial:
934+ <Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9
935+ 12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91
936+ 74 ef 2c ... 78 more bytes>
937+ */
938+ ```
939+ See the OpenSSL [ ` SSL_export_keying_material ` ] [ ] documentation for more
940+ information.
941+
907942### ` tlsSocket.getCertificate() `
908943<!-- YAML
909944added: v11.2.0
@@ -1113,6 +1148,18 @@ provided by SSL/TLS is not desired or is not enough.
11131148Corresponds to the ` SSL_get_peer_finished ` routine in OpenSSL and may be used
11141149to implement the ` tls-unique ` channel binding from [ RFC 5929] [ ] .
11151150
1151+ ### ` tlsSocket.getPeerX509Certificate() `
1152+ <!-- YAML
1153+ added: REPLACEME
1154+ -->
1155+
1156+ * Returns: {X509Certificate}
1157+
1158+ Returns the peer certificate as an {X509Certificate} object.
1159+
1160+ If there is no peer certificate, or the socket has been destroyed,
1161+ ` undefined ` will be returned.
1162+
11161163### ` tlsSocket.getProtocol() `
11171164<!-- YAML
11181165added: v5.7.0
@@ -1164,41 +1211,6 @@ See
11641211[ SSL_get_shared_sigalgs] ( https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html )
11651212for more information.
11661213
1167- ### ` tlsSocket.exportKeyingMaterial(length, label[, context]) `
1168- <!-- YAML
1169- added:
1170- - v13.10.0
1171- - v12.17.0
1172- -->
1173-
1174- * ` length ` {number} number of bytes to retrieve from keying material
1175- * ` label ` {string} an application specific label, typically this will be a
1176- value from the
1177- [ IANA Exporter Label Registry] ( https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels ) .
1178- * ` context ` {Buffer} Optionally provide a context.
1179-
1180- * Returns: {Buffer} requested bytes of the keying material
1181-
1182- Keying material is used for validations to prevent different kind of attacks in
1183- network protocols, for example in the specifications of IEEE 802.1X.
1184-
1185- Example
1186-
1187- ``` js
1188- const keyingMaterial = tlsSocket .exportKeyingMaterial (
1189- 128 ,
1190- ' client finished' );
1191-
1192- /**
1193- Example return value of keyingMaterial:
1194- <Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9
1195- 12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91
1196- 74 ef 2c ... 78 more bytes>
1197- */
1198- ```
1199- See the OpenSSL [ ` SSL_export_keying_material ` ] [ ] documentation for more
1200- information.
1201-
12021214### ` tlsSocket.getTLSTicket() `
12031215<!-- YAML
12041216added: v0.11.4
@@ -1213,6 +1225,18 @@ It may be useful for debugging.
12131225
12141226See [ Session Resumption] [ ] for more information.
12151227
1228+ ### ` tlsSocket.getX509Certificate() `
1229+ <!-- YAML
1230+ added: REPLACEME
1231+ -->
1232+
1233+ * Returns: {X509Certificate}
1234+
1235+ Returns the local certificate as an {X509Certificate} object.
1236+
1237+ If there is no local certificate, or the socket has been destroyed,
1238+ ` undefined ` will be returned.
1239+
12161240### ` tlsSocket.isSessionReused() `
12171241<!-- YAML
12181242added: v0.5.6
0 commit comments