const httpsOptions = {
key: FS.readFileSync("/etc/letsencrypt/live/site/privkey.pem"),
cert: FS.readFileSync("/etc/letsencrypt/live/site/fullchain.pem")
};
EACCES: permission denied
尝试使用选项设置HTTPS服务器。设置optiosn传递给
HttpS.createServer(httpsOptions,App);
时。我从letsencrypt获得了证书,但是尝试运行服务器会导致权限被拒绝错误。为HTTPS服务器加载证书和 key 文件的正确方法是什么?
最佳答案
证书没有正确的权限。
sudo chmod 755 /etc/letsencrypt/live/
尝试这个。希望能奏效
关于node.js - node.js FS无法从letencrypt读取证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48755030/