---
title: "Fix Nginx SSL Permission Denied (0200100D) error"
date: 2022-10-08T13:01:18.000Z
author: Z.SHINCHVEN
tags: [Nginx, SSL, SELinux]
canonical: https://atlassc.net/2022/10/09/nginx-ssl-permission-error
---
If you see Nginx SSL Error 0200100D like below, it means that Nginx is not allowed to access the SSL certificate file. 
This is usually a [SELinux](https://www.redhat.com/en/topics/linux/what-is-selinux) issue. 
You can fix it by using [restorecon](https://linux.die.net/man/8/restorecon) command to restore the SELinux context of the certificate file.

```text
nginx: [emerg] cannot load certificate "/etc/nginx/ssl/cert.pem": BIO_new_file() failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/nginx/ssl/cert.pem',...ew_file:system lib)
```

## Check If SELinux Is Enabled

```bash
sestatus
# output
SELinux status:                 enabled
```

## Restore SELinux Security Contexts to Fix Permission

```bash
restorecon /etc/nginx/ssl/*
```
