Skip to content

Instantly share code, notes, and snippets.

@notmedia
Created August 29, 2022 17:36
Show Gist options
  • Save notmedia/9af957f2109887723cb5ee4330f2c64d to your computer and use it in GitHub Desktop.
Save notmedia/9af957f2109887723cb5ee4330f2c64d to your computer and use it in GitHub Desktop.
function getChannelCredentials(): ChannelCredentials {
const rootCert = fs.readFileSync(path.resolve(__dirname, '../certs/ca-cert.pem'));
const clientCert = fs.readFileSync(path.resolve(__dirname, '../certs/client-cert.pem'));
const clientKey = fs.readFileSync(path.resolve(__dirname, '../certs/client-key.pem'));
const channelCredentials = ChannelCredentials.createSsl(rootCert, clientKey, clientCert);
return channelCredentials;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment