const httpsOptions = {
key: FS.readFileSync("/etc/letsencrypt/live/site/privkey.pem"),
cert: FS.readFileSync("/etc/letsencrypt/live/site/fullchain.pem")
};
EACCES: permission denied
Trying to set up a HTTPS server with options. While setting up the optiosn to pass to the HttpS.createServer(httpsOptions,App);
. I got the cert from letsencrypt however trying to run the server results in permission denied errors. What is the correct way to load the cert and key file for the HTTPS server?
@Wesgur answer did not help in my case, what did help was:
sudo chown $(whoami) /etc/letsencrypt/live/ -R
sudo chown $(whoami) /etc/letsencrypt/archive/ -R
Probably related to the fact that the live directory .pem files are symbolic links to the actual certificate and private key files in the archive directory...
The certificates doesn't have right permissions.
sudo chmod 755 /etc/letsencrypt/live/
Try this. Hope it works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With