MgetPeerCertificate
Bun

method

tls.TLSSocket.getPeerCertificate

detailed: true

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.

@param detailed

Include the full certificate chain if true, otherwise include just the peer's certificate.

@returns

A certificate object.

detailed?: false

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.

@param detailed

Include the full certificate chain if true, otherwise include just the peer's certificate.

@returns

A certificate object.

detailed?: boolean

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.

@param detailed

Include the full certificate chain if true, otherwise include just the peer's certificate.

@returns

A certificate object.