tlsSocket.getSession()


如果没有协商会话,则返回 TLS 会话数据或 undefined。在客户端,可以将数据提供给 tls.connect()session 选项来恢复连接。在服务器上,它可能对调试有用。

¥Returns the TLS session data or undefined if no session was negotiated. On the client, the data can be provided to the session option of tls.connect() to resume the connection. On the server, it may be useful for debugging.

有关详细信息,请参阅 会话恢复

¥See Session Resumption for more information.

注意:getSession() 仅适用于 TLSv1.2 及以下版本。对于 TLSv1.3,应用必须使用 'session' 事件(它也适用于 TLSv1.2 及更低版本)。

¥Note: getSession() works only for TLSv1.2 and below. For TLSv1.3, applications must use the 'session' event (it also works for TLSv1.2 and below).