My domain is: 1236.be
I ran this command:
certbot certonly --dry-run -d '1236.be,*.1236.be' -n --agree-tos --email some@address --manual --preferred-challenges dns --manual-auth-hook /home/logoadmin/auth-hook.sh --manual-cleanup-hook /home/logoadmin/scripts/server2/letsencrypt/cleanup-hook.sh
Note that this works when I pass only the base domain (1236.be) or only the wildcard domain (*.1236.be) or several non-wildcard domains, but not when I pass the base domain and the wildcard domain together, which seems like a common usecase (?).
It produced this output:
Certbot failed to authenticate some domains (authenticator: manual). The Certificate Authority reported these problems:
Domain: 1236.be
Type: unauthorized
Detail: Incorrect TXT record "oqF56pLpYPeNic7FSyIAIuslG5eRvd5mKGLaq6kgZ0I" found at _acme-challenge.1236.be
I changed my hook script to output information while being called:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Simulating a certificate request for *.1236.be and 1236.be
Hook '--manual-auth-hook' for 1236.be ran with output:
auth for 1236.be with validation 675M4pIxGHNAcqQLo4q3Y93AZjEBiakBhXTJn5AyP4c
New key, using POST
Reading back after setting - expecting : 675M4pIxGHNAcqQLo4q3Y93AZjEBiakBhXTJn5AyP4c
response text: {"rrset_name":"_acme-challenge","rrset_type":"TXT","rrset_ttl":300,"rrset_values":[""675M4pIxGHNAcqQLo4q3Y93AZjEBiakBhXTJn5AyP4c""],"rrset_href":"https://api.gandi.net/v5/livedns/domains/1236.be/records/_acme-challenge/TXT"}
Hook '--manual-auth-hook' for 1236.be ran with output:
auth for 1236.be with validation FzOg3BePN1L5GZvbiFI1G8rlpWgIZ4ZoHHVXpEXJ0qo
Existing key, using PUT
Reading back after setting - expecting : FzOg3BePN1L5GZvbiFI1G8rlpWgIZ4ZoHHVXpEXJ0qo
response text: {"rrset_name":"_acme-challenge","rrset_type":"TXT","rrset_ttl":300,"rrset_values":[""FzOg3BePN1L5GZvbiFI1G8rlpWgIZ4ZoHHVXpEXJ0qo""],"rrset_href":"https://api.gandi.net/v5/livedns/domains/1236.be/records/_acme-challenge/TXT"}
Certbot failed to authenticate some domains (authenticator: manual). The Certificate Authority reported these problems:
Domain: 1236.be
Type: unauthorized
Detail: Incorrect TXT record "FzOg3BePN1L5GZvbiFI1G8rlpWgIZ4ZoHHVXpEXJ0qo" found at _acme-challenge.1236.be
It seems certbot first calls the auth-hook script for each domain it needs to register before reading back the DNS values for these domains.
Hence this fails when a wildcard and a base domain are both present, since the CERTBOT_DOMAIN passed for both is (in my case) '1236.be', and hence they cannot be created with the same key and a different value at the same time.
Solution could be to check domain by domain, or to use a different CERTBOT_DOMAIN for wildcards.
First posting it here to see if this is worth mentioning as a bug or whether I am completely missing something
My web server is (include version): nginx 1.18.0
The operating system my web server runs on is (include version): Ubuntu 22.04.02 LTS
I can login to a root shell on my machine (yes or no, or I don't know): yes (sudo)
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): certbot 1.21.0