Skip to main content
TLSSocket.prototype.getPeerCertificate - node__tls.d.ts - Node documentation
method TLSSocket.prototype.getPeerCertificate

Usage in Deno

```typescript import { TLSSocket } from "node:node__tls.d.ts"; ```
TLSSocket.prototype.getPeerCertificate(detailed: true): DetailedPeerCertificate
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 an`issuerCertificate` property containing an object representing its issuer's certificate.

Parameters

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

Return Type

A certificate object.
TLSSocket.prototype.getPeerCertificate(detailed?: false): PeerCertificate

Parameters

optional
detailed: false

Return Type

TLSSocket.prototype.getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate

Parameters

optional
detailed: boolean

Return Type