When renewing a wildcard cert with this command
./certbot-auto certonly --manual --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns-01 -d .ottawajazzscene.ca -d ottawajazzscene.ca
I get this mysterious error:
Certificate did not match expected hostname: acme-v02.api.letsencrypt.org. Certificate: {‘subjectAltName’: [(‘DNS’, '.ottawajazzscene.ca’), (‘DNS’, ‘ottawajazzscene.ca’)], ‘subject’: (((‘commonName’, u’ottawajazzscene.ca’),),)}
An unexpected error occurred:
SSLError: hostname ‘acme-v02.api.letsencrypt.org’ doesn’t match either of ‘*.ottawajazzscene.ca’, ‘ottawajazzscene.ca’
Please see the logfiles in /var/log/letsencrypt for more details.
(Python stacktrace available if needed)
./certbot-auto --version
certbot 0.26.1
I believe I have renewed the cert once in June, after getting the initial cert in March.
The certbot-auto command is in a shell script file, leading me to think I used it before as-is and it worked.
Any ideas, please?
Also, does anyone know of a script to automate the txt record placement to insert into a bind zone?
There should be a wildcard before the domain? - I don’t see one in your post:
Try copy-paste the following: ./certbot-auto certonly --manual --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns-01 -d *.ottawajazzscene.ca -d ottawajazzscene.ca
Generally agreed. But if you read the error message I included with my question you can see that certbot-auto correctly parsed the command line and -d args; it put them in quotes. anyway, I added quotes and that didn't change anything.
It looks to me based on this error message that your machine resolved the acme-v02.api.letsencrypt.org domain to the wrong IP and when Certbot connected to port 443 it ended up getting back a certificate for your own domain name.
Can you verify that the recursive DNS resolver settings on your server are correct? Can you share the output of running: openssl s_client -connect acme-v02.api.letsencrypt.org:443 -servername acme-v02.api.letsencrypt.org </dev/null
and dig acme-v02.api.letsencrypt.org
(Small world! Ex-Carleton? I studied engineering there.) Thanks for all your help on this community forum, cpu. LE wouldn't be as valuable and adopted as it is without the excellent help you and others have provided here. Bravo.