tlsSocket.authorized
- 类型:<boolean>
如果对等证书是由创建 tls.TLSSocket 实例时指定的某个 CA 签署的,则此属性为 true,否则为 false。
🌐 This property is true if the peer certificate was signed by one of the CAs
specified when creating the tls.TLSSocket instance, otherwise false.
只有在完整的 TLS 握手过程中才会验证对方证书。当通过恢复之前的会话建立连接时(参见 会话恢复),验证不会重复进行:authorized 和 authorizationError 会携带会话中保存的结果,包括任何验证错误以及客户端根本没有提供证书的情况。
🌐 The peer certificate is only verified during a full TLS handshake. When a
connection is established by resuming a previous session (see
Session Resumption), verification is not repeated: authorized and
authorizationError carry the result stored with the session, including
any verification error and the case where the client presented no
certificate at all.