I am trying to install an SSL certificate on my Ubuntu server. I have purchased the certificate from my CA and have downloaded the certificate itself and an intermediate certificate. As so:
my certificate: mydomain.crt
intermediate certificate: GandiStandardSSLCA.pem
I also have (made using openssl)
my private key (?): mydomain.key
and signing request: mydomain.csr
I have uploaded all these files to my server and followed a guide to combine my certificate with the intermediate:
cat mydomain.crt GandiStandardSSLCA.pem > mydomain-bundle.crt
I then add the following to my vhost's config:
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/mydomain-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/mydomain.key;
But when I go to restart nginx I get this error:
* Restarting nginx
* Stopping nginx nginx [ OK ]
nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/nginx/ssl/mydomain.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch) nginx: configuration file /etc/nginx/nginx.conf test failed
Any ideas why and how to solve?
ca-bundle
?