To fix Node.js https pem error: routines:PEM_read_bio:no start line,. we read the SSL key and certificate file.
For instance, we write
const options = {
key: fs.readFileSync("./key.pem", "utf8"),
cert: fs.readFileSync("./server.crt", "utf8"),
};
to read key
and cert
files with readFileSync
.
key
is the key file.
And cert
is the certificate file.