M
M
MalikDeveloper20772020-08-20 19:00:39
Nginx
MalikDeveloper2077, 2020-08-20 19:00:39

SSL nginx [emerg] cannot load certificate “/etc/ssl/diasmart_shop.crt”: PEM_read_bio_X509() failed not proc type?

I have the correct crt certificate file and key file (/etc/ssl/diasmart_shop.crt and /etc/ssl/diasmart_shop.key) When I wrote this for crt and key files, there were no errors. The command displays the certificate itself:

openssl x509 -in /etc/ssl/diasmart_shop.crt -noout -text -purpose


My nginx config:
server {
        listen 80 default_server;
        listen [::]:80 default_server;
        root /var/www/html;

        index index.html index.htm index.nginx-debian.html;

        listen 443 ssl;
        ssl_certificate /etc/ssl/diasmart_shop.crt;
        ssl_certificate_key /etc/ssl/diasmart_shop.key;
        server_name my_domain;


When I restart nginx after adding the changes for ssl, I got this error in the logs with the systemctl status nginx.service command :

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2020-08-20 15:11:15 UTC; 26s ago
       Docs: man:nginx(8)
    Process: 8725 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Aug 20 15:11:15 diasmart systemd[1]: Starting A high performance web server and a reverse proxy server...

# ------- THERE'S THE ERROR ------- 
Aug 20 15:11:15 diasmart nginx[8725]: nginx: [emerg] cannot load certificate "/etc/ssl/diasmart_shop.crt": PEM_read_bio_X509() failed (SSL: error:0906B06B:PEM routines:PEM_get_EVP_CIPHER_INFO:not proc type>
# ------- END OF THE ERROR ------- 

Aug 20 15:11:15 diasmart nginx[8725]: nginx: configuration file /etc/nginx/nginx.conf test failed
Aug 20 15:11:15 diasmart systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Aug 20 15:11:15 diasmart systemd[1]: nginx.service: Failed with result 'exit-code'.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-08-20
@MalikDeveloper2077

show the rights to the folder and the certificate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question