Skip to content

Instantly share code, notes, and snippets.

@FloStar3000
Created March 23, 2021 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FloStar3000/79ebaf9e24ed1b57fd385463010051d5 to your computer and use it in GitHub Desktop.
Save FloStar3000/79ebaf9e24ed1b57fd385463010051d5 to your computer and use it in GitHub Desktop.
Nodejs: Format CA Cert for WiFiClientSecure
// 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