Last active
August 29, 2022 15:17
-
-
Save notmedia/70e2f2e3dc073be26c40912929d5a70b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getServerCredentials(): ServerCredentials { | |
const rootCert = fs.readFileSync(path.resolve(__dirname, '../certs/ca-cert.pem')); | |
const serverCert = fs.readFileSync(path.resolve(__dirname, '../certs/server-cert.pem')); | |
const serverKey = fs.readFileSync(path.resolve(__dirname, '../certs/server-key.pem')); | |
const serverCredentials = ServerCredentials.createSsl( | |
rootCert, | |
[ | |
{ | |
cert_chain: serverCert, | |
private_key: serverKey, | |
}, | |
], | |
true | |
); | |
return serverCredentials; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment