NodeJS & SSL – “bad password read”

This is because you’ve specified a passphrase when generating the cert. This is a password that must be supplied by anyone wanting to use it.

Adding a passphrase field to the credentials solves the problem.

var credentials = {
    key: fs.readFileSync('XXX.key', 'utf8'),
    cert: fs.readFileSync('XXX.crt', 'utf8'),
    passphrase: 'XXXX'
}

var httpsServer = https.createServer(credentials, app);

Leave a Comment