getCert

View as MarkdownOpen in Claude

Read the PEM certificate file from disk.

Parameters

None.

Returns

string | null — The certificate file contents, or null if the file path is not set or the file does not exist.

Example

1import { SslConfig } from '@signalwire/sdk';
2
3const ssl = new SslConfig({ certPath: './cert.pem', keyPath: './key.pem' });
4const cert = ssl.getCert();
5console.log(cert ? 'Certificate loaded' : 'Certificate not found');