Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1501

Error: EACCES: permission denied when configuring https server on AWS Lightsail

$
0
0
Error: EACCES: permission denied, open '/opt/bitnami/apache/conf/bitnami/certs/server.key'    at Object.openSync (node:fs:596:3)    at Object.readFileSync (node:fs:464:35)    at file:///home/bitnami/myproj/server/index.js:15:14    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {  errno: -13,  syscall: 'open',  code: 'EACCES',  path: '/opt/bitnami/apache/conf/bitnami/certs/server.key'}

That's the error I get when I try to configure my express server that's deployed on AWS lightsail to use HTTPS. I added the https config like this:

const options = {    key: fs.readFileSync('/opt/bitnami/apache/conf/bitnami/certs/server.key'),    cert: fs.readFileSync('/opt/bitnami/apache/conf/bitnami/certs/server.crt'),}const server = https.createServer(options, app);server.listen(5000, () => {  console.log('HTTPS Server running on port 5000');});

What's the proper way for me to grant permission to my express app to access the https files?


Viewing all articles
Browse latest Browse all 1501

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>