ssl-certificatenginx-configgodaddy-api

Godaddy SSL Certificates Install in NGINX Server | Failing


I have requested SSL Certificate from GoDaddy, I got Private Key & CSR file, which downloaded as TEXT format. enter image description here

I have modified file extensions as follows

**Original File Names**
firstcsrfile.txt
firstprivatekey.txt

**After Renaming File Names**
firstcsrfile.csr
firstprivatekey.key

domain.com.chained with below files downloaded from GoDaddy by selecting other option enter image description here From above files

cat domain.com.crt intermediate.crt > domain.com.chained.crt

My nginx.conf file

worker_processes 4;

events { worker_connections 1024; }

http {
    server {
        listen 443 ssl;
        server_name _;

        ssl_certificate     /etc/nginx/ssl/domain.com.chained.crt;
        ssl_certificate_key /etc/nginx/ssl/firstprivatekey.key;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        add_header Strict-Transport-Security max-age=15768000;

        include /etc/nginx/mime.types;

        location / {
            root  /usr/share/nginx/html;
        }
    }
}

I have tried multiple times with various approaches but always same error

2022/10/24 13:51:20 [emerg] 1#1: SSL_CTX_use_PrivateKey("/etc/nginx/ssl/firstprivatekey.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
nginx: [emerg] SSL_CTX_use_PrivateKey("/etc/nginx/ssl/firstprivatekey.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)

I have followed few blogs from Godaddy and some random blogs https://blog.yudiz.com/install-ssl-certificate-with-nginx/ Since last 6-7 days struggled a lot, and where I am doing mistakes not sure !!.


Solution

  • enter image description here

    First You should chose other and download, after that In the downloaded file you will combine the .crt and bundle.crt file.

    You will save it as a .pem in the /etc/nginx/ssl file path. I tried to do that as well.