Created
March 23, 2021 15:22
-
-
Save FloStar3000/79ebaf9e24ed1b57fd385463010051d5 to your computer and use it in GitHub Desktop.
Nodejs: Format CA Cert for WiFiClientSecure
This file contains 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
// use exported ca root cert from browser | |
const rawCert = fs.readFileSync('certfile','utf-8') | |
const lines = rawCert.split('\r\n') | |
const linesFormatted = lines.map(line=>`\"${line}\\n\" \\`) | |
// | |
fs.writeFileSync('cert.txt',linesFormatted.join('\n')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment