tlsSocket.getPeerCertificate([detailed])


  • detailed <boolean> 如果为 true,则包含完整的证书链,否则仅包含对等方的证书。

    ¥detailed <boolean> Include the full certificate chain if true, otherwise include just the peer's certificate.

  • 返回:<Object> 证书对象。

    ¥Returns: <Object> A certificate object.

返回代表对等方证书的对象。如果对端没有提供证书,则将返回空对象。如果套接字被销毁,则返回 null

¥Returns an object representing the peer's certificate. If the peer does not provide a certificate, an empty object will be returned. If the socket has been destroyed, null will be returned.

如果请求完整的证书链,则每个证书都将包含一个 issuerCertificate 属性,其中包含代表其颁发者证书的对象。

¥If the full certificate chain was requested, each certificate will include an issuerCertificate property containing an object representing its issuer's certificate.