Problème de renouvellement de certificat

Je peux lire des réponses en Anglais : oui

Mon nom de domaine est : mon.tk (accès restreint)

J’ai exécuté cette commande : sudo certbot renew --dry-run Elle a produit cette sortie :
Cert is due for renewal, auto-renewing…
Plugins selected: Authenticator dns-cloudflare, Installer None
Renewing an existing certificate
Performing the following challenges:
dns-01 challenge for mon.tk
dns-01 challenge for mon.tk
Cleaning up challenges
Attempting to renew cert (mon.tk) from /etc/letsencrypt/renewal/mon.tk.conf produced an unexpected error: ‘code’. Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/mon.tk/fullchain.pem (failure)

Mon serveur Web est (inclure la version) : Ubuntu 18.04.3 LTS Codename: bionic+ apache 2.4

Je peux me connecter à un shell root sur ma machine :oui

extrait du fichier log :
2020-04-26 07:37:43,211:DEBUG:certbot.main:certbot version: 0.31.0
2020-04-26 07:37:43,212:DEBUG:certbot.main:Arguments: [’-q’]
2020-04-26 07:37:43,213:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2020-04-26 07:37:43,222:DEBUG:certbot.log:Root logging level set at 30
2020-04-26 07:37:43,223:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2020-04-26 07:37:43,225:INFO:certbot.storage:Attempting to parse the version 0.37.1 renewal configuration file found at /etc/letsencrypt/renewal/mon.tk.conf with version 0.31.0 of Certbot. This might not work.
2020-04-26 07:37:43,232:DEBUG:certbot.plugins.selection:Requested authenticator <certbot.cli._Default object at 0x7f79b7853c19> and installer <certbot.cli._Default object at 0x7f79b7853c19>
2020-04-26 07:37:43,232:WARNING:certbot.renewal:Renewal configuration file /etc/letsencrypt/renewal/mon.tk.conf (cert: mon.tk) produced an unexpected error: ‘Namespace’ object has no attribute ‘dns_cloudflare_credentials’. Skipping.
2020-04-26 07:37:43,234:DEBUG:certbot.renewal:Traceback was:

Contenu de /etc/letsencrypt/renewal/ mon.tk.conf
renew_before_expiry = 30 days
version = 0.31.0
archive_dir = /etc/letsencrypt/archive/mon.tk
cert = /etc/letsencrypt/live/mon.tk/cert.pem
privkey = /etc/letsencrypt/live/mon.tk/privkey.pem
chain = /etc/letsencrypt/live/mon.tk/chain.pem
fullchain = /etc/letsencrypt/live/mon.tk/fullchain.pem

Options used in the renewal process
[renewalparams]
account = b121b3a30a93e7b21a…
authenticator = apache
installer = apache
server = https://acme-v02.api.letsencrypt.org/directory

certbot --version || /path/to/certbot-auto --version
’ resultat : cerbot 0.37.1’

sudo certbot certificates
Found the following certs:
Certificate Name: mon.tk
Domains: mon.tk *.mon.tk
Expiry Date: 2020-05-10 10:09:41+00:00 (VALID: 11 days)
Certificate Path: /etc/letsencrypt/live/mon.tk/fullchain.pem
Private Key Path: /etc/letsencrypt/live/mon.tk/privkey.pem


Bonjour à tous,

Rien qu’a lire les lignes du dessus vous avez compris le problème : renouvellement du certificat impossible… j’ai observé que dans mon /etc/letsencrypt/accounts/ il y avait deux “account”
J’ai trouvé quelqu’un qui avait un problème similaire :


mais je suis dubitatif et je ne suis pas sûr de la bonne manip.

Faut-il d’abord régler les problèmes de versions de cerbot 0,37 et 0,31 qui apparaissent dans les logs ?

Merci pour votre aide

J’avais deux install de cerbot, une par les dépots (PIP) et l’autre “officiell” (la 0,31 et la 0,37).
J’ai supprimer la “PIP” et j’ai conserver la stable la 0,31
Maintenant cerbot–version me donne la 0,31

Bon après quelques recherches et nombreuses mises à jour, je pense que j’ai un problème avec mon DNS : Mon champ TXT est vide, pas d’"_acme-challenge". Normalement ce champ avait du se remplir avec le plugin ’ cloudflare credentials" et resté non ?

Sur https://check-your-website.server-daten.de

Misconfiguration - http-status 400 - 499

https://mon.tk/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de

Fatal: Check of /.well-known/acme-challenge/random-filename has a http status 401 / 403 Not Allowed / Forbidden. A http status 404 - Not Found - is expected. Creating a Letsencrypt certificate via http-01 challenge may not work. Trouble creating a certificate?

Use https://community.letsencrypt.org/ to ask.
Je chauffe ?

Hi @Bob

that's not relevant because you want to create a wildcard certificate. So you must use dns validation, not http validation.

And there is no check of mon.tk. Read the #txt part.

But I don't know how that

works.

Hi Juergen;

Thanks for your reply.

I forgot to say “mon.tk” is not the real name (it’s a bit longer)

i use this command to create my first certificate :
sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /root/.secrets/cloudflare.cfg -d mon.tk,*.mon.tk --preferred-challenges dns-01

there is the TXT part


i change nameserveur

With dig -t TXT _acme-challenge.mon.tk i get :

; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> -t TXT _acme-challenge…tk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 47714
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;_acme-challenge…tk. IN TXT
;; AUTHORITY SECTION:
.tk. 3589 IN SOA jerome.ns.cloudflare.com. dns.cloudflare.com. 2033299959 10000 2400 604800 xxxx
;; Query time: 1 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Sun May 03 11:08:29 CEST 2020
;; MSG SIZE rcvd: 131

Contenu actuel de /etc/letsencrypt/renewal/ mon.tk.conf
version = 0.37.1

[renewalparams]
account = b121b3xxxxxx
authenticator = dns-cloudflare
server = https://acme-v02.api.letsencrypt.org/directory
pref_challs = dns-01,
dns_cloudflare_credentials = /root/.secrets/cloudflare.cfg

Quelques nouvelles :

Mon certificat a finalement expiré.
Pour le renouveler j’ai exécuté :
rm -rf /etc/letsencrypt/live/{DOMAIN} rm -rf /etc/letsencrypt/renewal/{DOMAIN}.conf
rm -rf /etc/letsencrypt/archive/${DOMAIN}

sudo certbot certonly --manual -d *.mon.tk -d mon.tk --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory

et j’ai aussi réglé quelques lignes dans mon Vhost.

Après avoir fait du copier coller dans le champ TXT de mon DNS j’ai récupérer un certificat pour 3 mois. :slight_smile:

Probléme : avec la commande que j’ai utilisé certbot renew dans ce cas ne fonctionnera pas ! :disappointed: donc je pense que je n’ai pas fini de galérer…

A bientôt (probablement) et merci à tous les bénévoles de ce beau projet.