/usr/bin/cerbot certificates
Attempting to parse the version 1.9.0 renewal configuration file found at /etc/letsencrypt/renewal/suinot.org-0002.conf with version 0.31.0 of Certbot. This might not work.
Attempting to parse the version 1.3.0 renewal configuration file found at /etc/letsencrypt/renewal/suinot.org.conf with version 0.31.0 of Certbot. This might not work.
Certificate Name: suinot.org-0001
Domains: suinot.org imap.suinot.org lil-elefen.suinot.org mastodon.suinot.org nextcloud.suinot.org webssh.suinot.org www.suinot.org
Expiry Date: 2021-07-07 11:46:48+00:00 (VALID: 37 days) ... and more details
Certificate Name: suinot.org-0002
Domains: suinot.org imap.suinot.org mastodon.suinot.org nextcloud.suinot.org webssh.suinot.org www.suinot.org
Expiry Date: 2021-07-30 21:04:14+00:00 (VALID: 60 days) ... and more details
Certificate Name: suinot.org
Domains: suinot.org imap.suinot.org lil-elefen.suinot.org mastodon.suinot.org nextcloud.suinot.org webssh.suinot.org www.suinot.org
Expiry Date: 2021-07-07 11:46:48+00:00 (VALID: 37 days)
My web server is nginx (v 1.14.2 on debian stable) and work fine with the suinot.org-0002 certificate, but there is no subdomain lil-elefen.suinot.org.
The version of certbot is 0.31.0 (debian package)
I think of a bad handling on my part.
Can I remove the suinot.org-0002 configuration and reuse suinot.org-0001 and then add another subdomain?
Likewise, is the first suinot.org certificate necessary?
Which subdomain do you wish to add? Because as far as I can tell, the certificates with names suinot.org and suinot.org-0001 are identical and already contain the subdomain lil-elefen.suinot.org missing from the 0002-cert.
Before deleting a certificate, make sure your nginx configuration is updated to not use a certificate you're about to delete, but one of the certificates you won't delete. Otherwise your nginx won't restart or reload, as it wouldn't be able to find a certificate to use.
As suinot.org and suinot.org-0001 are identical, you can remove one of those indeed. I'd get rid of the version with that unnecessary -0001 part.
If you wish to update your certificate with new subdomains, you could use the --cert-name flag "overwrite" an existing certificate, so you won't end up with those -0001, -0002 or perhaps even a -0003 version.
It seems once upon a time you've had version 1.9.0 of certbot installed, but somehow downgraded to a very old version, 0.31.0. There's a good chance more recent versions than 0.31.0 have better handeling and identification of certificate expansion which wouldn't lead that easy to those duplicate certificates like you have now. If you can upgrade, I'd recommend it.
I would like to add the nicolas.suinot.org subdomain (I wonder if each time I added a subdomain, it didn't add an additional -0001 then -0002 file)
Yes, of course, otherwise, nginx will not understand anything
ok, I agree. Remainder of -0002
Version 0.31.0 is the official release of Debian Stable. But my first certificates were made with the version from the official site (ahead of the version compared to Debian). Since then, I have been using / usr / bin / certbot from the Debian package. Not good...
Thank you for your explanations.
How do I remove unnecessary -0001?
The path of the certificate and the private key are the same for suinot.org and suinot.org-0001!
How remove -0001 whithout remove path for certificat and key path for suinot.org?
And now for all of my certificate operations I'll use --cert-name
That's very strange! Usually this is the result of manual tampering with the symbolic links in /etc/letsencrypt/live/. Does that sound familiair?
I think you probably should fix the symbolic links in /etc/letsencrypt/live/suinot.org/ first. Now, they probably refer to the ../../archive/suinot.org-0001/ which is obiously wrong. They should point to the files in ../../archive/suinot.org/.
If you've fixed the symlinks (and verified with certbot certificates), you can delete the suinot.org-0001 cert.
Sorry, I probably had to be more clear: the symlinks are in the directories which themselves are in the /live/ directory and the same goes for the actual files in /archive/: you can find them in the directories in the /archive/ directory. I.e.:
ls -l /etc/letsencrypt/live/suinot.org/
ls -l /etc/letsencrypt/live/suinot.org-0001/
Here are the two conf files: suinot.org.conf and suinot.org-0001.conf
(I have deleted the account number. Just for the sake of safety. Tell me if I'm paranoid ...)
# cat renewal/suinot.org-0001.conf
# renew_before_expiry = 30 days
version = 0.31.0
archive_dir = /etc/letsencrypt/archive/suinot.org-0001
cert = /etc/letsencrypt/live/suinot.org-0001/cert.pem
privkey = /etc/letsencrypt/live/suinot.org-0001/privkey.pem
chain = /etc/letsencrypt/live/suinot.org-0001/chain.pem
fullchain = /etc/letsencrypt/live/suinot.org-0001/fullchain.pem
# Options used in the renewal process
[renewalparams]
installer = nginx
authenticator = nginx
account = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
server = https://acme-v02.api.letsencrypt.org/directory
nginx_ctl = /usr/sbin/nginx
master 10:41:48 root /etc/letsencrypt
# cat renewal/suinot.org.conf
# renew_before_expiry = 30 days
version = 1.3.0
archive_dir = /etc/letsencrypt/archive/suinot.org-0001
cert = /etc/letsencrypt/live/suinot.org-0001/cert.pem
privkey = /etc/letsencrypt/live/suinot.org-0001/privkey.pem
chain = /etc/letsencrypt/live/suinot.org-0001/chain.pem
fullchain = /etc/letsencrypt/live/suinot.org-0001/fullchain.pem
# Options used in the renewal process
[renewalparams]
authenticator = nginx
account = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
server = https://acme-v02.api.letsencrypt.org/directory
webroot-path=/home/www/
You should remove the -0001 parts on those 5 lines from the renewal/suinot.org.conf file: those are not supposed to be there.
Don't delete the entire -0001 cert itself yet by the way, first I want to see if the cert is OK after the renewal config file is fixed. (Please run certbot certificates again for that.)
Result:
I started deleting the 5 lines of configurations:
The file was therefore like
# renew_before_expiry = 30 days
version = 0.31.0
archive_dir = /etc/letsencrypt/archive/suinot.org-0001
cert = /etc/letsencrypt/live/suinot.org-0001/cert.pem
privkey = /etc/letsencrypt/live/suinot.org-0001/privkey.pem
chain = /etc/letsencrypt/live/suinot.org-0001/chain.pem
fullchain = /etc/letsencrypt/live/suinot.org-0001/fullchain.pem
# Options used in the renewal process
[renewalparams]
I launched Certbot Certificates, to see the result first:
An unexpected error occurred:
KeyError: 'renewalparams'
Please see the logfiles in /var/log/letsencrypt for more details.
It's logical, the configuration part is no longer there (I had made a backup before)
Then I deleted the 5 previous lines but I gave the configuration part, and revived Certbot Certificates
Sorry, perhaps I needed to be more clear. I didn't mean to delete entire lines but just the characters -0001from those 5 lines mentioning those 5 characters. Not the entire line.
I think you removed the -0001 from the wrong configuration file, as the "Certificate Name" and paths are now reversed! The certificate with the name without the -0001 has paths with the -0001 and the cert name with the -0001 has paths without it.
Also, why the /live/suinot.org/ cert is expired? Probably because earlier certbot didn't even know it existed any longer when the paths in the renewal configuration file for the cert with name "suinot.org" were suddenly paths to the -0001 live directory. So it was never renewed!
So to make clear: the actual certificate in /etc/letsencrypt/live/suinot.org-0001/ is the good certificate, but is now referenced in the certificate renewal file for the suinot.org certificate name.
Earlier we told ourselves you could remove the -0001 cert, but you shouldn't do that now, as we now know the certificate at /etc/letsencrypt/live/suinot.org/ is old, wrong hostnames and expired.
My suggestion:
Fix your two renewal configuration files, so the paths are in line with the certificate name (i.e.: reverse the -0001 between the two files
delete the expired certificate: check with certbot certificates and delete the one which says expired.