andreaswolf / ansible-role-letsencrypt

Ansible role for generating certificates with acme-tiny via Let’s encrypt
46 stars 20 forks source link

Key values mismatch #31

Closed jcalonso closed 7 years ago

jcalonso commented 8 years ago

Hi there,

I'm generating multi-domain certificates like this:

Everything seems correct until I try to run nginx, I get the following error:

nginx -t
nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/ssl/letsencrypt/keys/subdomain.mydomain.com.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
nginx: configuration file /etc/nginx/nginx.conf test failed

My nginx config looks like this:

server {
    listen 443 ssl default_server;
    ssl_certificate /etc/ssl/letsencrypt/certs/subdomain.mydomain.com.crt;
    ssl_certificate_key /etc/ssl/letsencrypt/keys/subdomain.mydomain.com.key;
    server_name subdomain.mydomain.com;

I also tried generating and a chained cert and replacing the crt for the pem in the nginx config.

Any ideas what I'm doing wrong?

vatavale commented 8 years ago

I believe you can find answer here: http://nginx.org/en/docs/http/configuring_https_servers.html#chains

jcalonso commented 7 years ago

This was my error, closing ticket.