I am trying to use HTTPS on my Node.js app, just as it is already enabled for anything else. I have the keys and certificates already installed, but I get a Error: EACCES, permission denied
when I tried to point to them on the app.
Both the key and the certificate are in subfolder of /etc/pki/tls
, and I attempted pointing to them like this:
var privateKey = fs.readFileSync('/etc/pki/tls/private/serverKey.key').toString(),
certificate = fs.readFileSync('/etc/pki/tls/certs/2_mikewarren.me.crt').toString();
var options = {
key: privateKey,
cert: certificate
}
Do I need to adjust the permissions of the keys and certificates (via chown
)? If so, is it safe to do?