getCertificate

Bun

Symbol

TCPSocket.getCertificate

getCertificate(): null | object | PeerCertificate

Returns an object representing the local certificate. The returned object has some properties corresponding to the fields of the certificate.

If there is no local certificate, an empty object will be returned. If the socket has been destroyed, null will be returned.