error:0200100D:system library:fopen:Permission denied:fopen

nginx: [emerg] BIO_new_file("/etc/pki/tls/certs/bungle.pem") failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/pki/tls/certs/bungle.pem','r') error:2006D002:BIO routines:BIO_new_file:system lib)
Debug the situation of your directory where the certificate file is located:
ls -lrtZ /etc/pki/tls/certs
Usually every file should have line starting like:
-rw-r--r--. root root unconfined_u:object_r:cert_t:s0
And at your scenario one of lines have this content:
-rw-r--r--. root root unconfined_u:object_r:user_home_t:s0
Solution is move back your pem file where it has begin the story.
Please copy pem file to /etc/pki/tls/certs and check again permissions:
ls -lrtZ /etc/pki/tls/certs
Interesting files:
https://curl.haxx.se/ca/cacert.pem

3 comments:

  1. I was looking at permission-related solutions, until I found this. This solved my problem. Thank you!

    ReplyDelete
  2. This Solved my issue too. thanks so much !

    ReplyDelete
  3. Thank you, I just learned today that 'mv' doesn't work the same way as 'cp' with regard to the security context of files.

    ReplyDelete