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

Usage in Deno

```typescript import { TLSSocket } from "node:node__tls.d.ts"; ```
TLSSocket.prototype.getCertificate():
PeerCertificate
| object
| null
Returns an object representing the local certificate. The returned object has some properties corresponding to the fields of the certificate. See TLSSocket.getPeerCertificate for an example of the certificate structure. If there is no local certificate, an empty object will be returned. If the socket has been destroyed, `null` will be returned.

Return Type

PeerCertificate
| object
| null