method
tls.TLSSocket.getPeerCertificate
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.
If the full certificate chain was requested, each certificate will include anissuerCertificate property containing an object representing its issuer's certificate.
Include the full certificate chain if true, otherwise include just the peer's certificate.
A certificate object.
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.
If the full certificate chain was requested, each certificate will include anissuerCertificate property containing an object representing its issuer's certificate.
Include the full certificate chain if true, otherwise include just the peer's certificate.
A certificate object.
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.
If the full certificate chain was requested, each certificate will include anissuerCertificate property containing an object representing its issuer's certificate.
Include the full certificate chain if true, otherwise include just the peer's certificate.
A certificate object.
Referenced types
interface DetailedPeerCertificate
- asn1Curve?: string
The ASN.1 name of the OID of the elliptic curve. Well-known curves are identified by an OID. While it is unusual, it is possible that the curve is identified by its mathematical properties, in which case it will not have an OID.
- fingerprint: string
The SHA-1 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - fingerprint256: string
The SHA-256 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - fingerprint512: string
The SHA-512 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - issuerCertificate: DetailedPeerCertificate
The issuer certificate object. For self-signed certificates, this may be a circular reference.
- nistCurve?: string
The NIST name for the elliptic curve, if it has one (not all well-known curves have been assigned names by NIST).
- subjectaltname?: string
A string containing concatenated names for the subject, an alternative to the
subjectnames.
interface PeerCertificate
- asn1Curve?: string
The ASN.1 name of the OID of the elliptic curve. Well-known curves are identified by an OID. While it is unusual, it is possible that the curve is identified by its mathematical properties, in which case it will not have an OID.
- fingerprint: string
The SHA-1 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - fingerprint256: string
The SHA-256 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - fingerprint512: string
The SHA-512 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - nistCurve?: string
The NIST name for the elliptic curve, if it has one (not all well-known curves have been assigned names by NIST).
- subjectaltname?: string
A string containing concatenated names for the subject, an alternative to the
subjectnames.