Thanks for the links/pointers. I have already posted there to no avail.
The funny thing is: the show cert command works on a different certificate which I obtained via certbot formerly. That is RSA2048 type. The questionable one is supposedly an ECC certificate (?)
How can I analyze the certificate using local a command, e.g. openssl ... (file contains a private key which I don't want to expose to public cert testing sites)?
"Revoking, removing, erasing certs obtained using acme.sh"
Why do you need to revoke a cert?
You can "remove"/"erase" a cert by deleting [all copies of] it.
What do you mean by "analyze"?
If you only want to see if it is RSA or ECC, you can tell quickly by the size of the key file.
[How big is the key file?]
If you want to know more details, you can simply show us [just] the public cert file here.
[never show anyone your private key files]
Revoke was wrong here. I just meant remove. Yes, thanks. I found it and removed it.
I'm still chasing for the reason why haproxy isn't accepting the cert file. Haproxy requires to paste the private key into the fullchain.cert.
I did so manually for the cerbot obtained cert file. And haproxy works on this while it doesn't
on the acme.sh obtained cert.
The acme.sh --issue command says, that the domain I'm requesting has an ecc certificate already. It says this on creation (--issue) as on removal as well:
acme@mail:~$ acme.sh --remove -d www.mydomain.org
[Sat Nov 11 10:34:10 AM CET 2023] The domain 'www.mydomain.org' seems to have a ECC cert already, lets use ecc cert.
[Sat Nov 11 10:34:10 AM CET 2023] www.mydomain.org is removed, the key and cert files are in /var/lib/acme/.acme.sh/www.mydomain.org_ecc
[Sat Nov 11 10:34:10 AM CET 2023] You can remove them by yourself.
Perhaps your HAProxy doesn't like ECC certs...? ? ?
I would try feeding it an RSA cert.
Then, if you don't need an ECC cert and it does like the RSA cert, you can switch to using RSA.
If it doesn't like that RSA cert either, then you might be doing something wrong.
If it does like the RSA cert BUT you do need to use an ECC cert...
Then you may need to dig deeper into how you created that ECC cert OR visit an HAProxy support channel [I'm not sure this is the best place to get help with that kind of problem].
You should be able to specify the cert type you desire from acme.sh.
I don't use HAProxy, so I can't be certain how they work together.
But I have used acme.sh and have asked it to provide both types of certs for the same domain name without any issues.
Now you can review the certs in the system - something like: "acme.sh --list"
Then you can remove/delete whichever certs are no longer needed and no longer being used.
Thanks. I see two certificates listed by the acme.sh --list command.
Actually, I don't want to keep the ec256 certificate. What is the difference between
"removing" and "revoking" the certificate? Do I have to do both in sequence?
Now, that I have the multidomain cert obtained by the acme.sh challenge, I seem to not need
the certbot generated certificate anymore, do I ? Even more, would they interfere with the new cert?
The acme certs are in /var/lib/acme/.acme.sh
The certbot ones in /etc/letsencrypt/.
What mechanism now takes care for the automatic renewals?
In acme.sh, "removing" only deletes the certificate from its' maintenance.
You must physically update anything that may still be using it; And you must also delete the files on disk [if you want to - when you no longer need them].
In all cases, "revoking" tells the CA that the cert has [possibly] been compromised and it should be defined as "untrusted". This process is very resource consuming and should NOT be taken lightly.
The two things are NOT interchangeable, nor equal.
If you simply don't need a cert anymore, just remove it.
Certs don't interfere with each other.
If you no longer need the certs in certbot, run certbot delete and follow the prompts.
ACME clients normally install a line in cron or systemd that takes care of renewing managed certs.
So, you should NOT need to do anything for them to renew.
Thanks, very helpful, your remarks.
Just a few questions on further understanding:
With certbot I had these symlinks from /etc/letsencrypt/live/domain/ to /etc/letsencrypt/archive/domain, allowing to always use the symlink and having the correct valid cert behind it.
How does this work with acme.sh? There are these deploy scripts. Where can I read about how they are used?
I cannot find any traces of acme in /etc/*. (grep -r acme /etc/* doesn't yield anything meaningful).
Maybe despite of:
In acme.sh, I believe by default the certs are located within /root/.acme.sh/ and the renewals overwrite the existing files - so, you only need to point the web server to it once.
Try these: sudo find / -name fullchain.cer sudo locate fullchain.cer
I did the revoking/removing a minute before and let me --issue new certs with --keylength 2048 and they're all in ~acme/.acme.sh.
They are sitting there but nothing has been deployed to the webserver so far.
I wonder how this mechanism works in haproxy (will ask this in their forum).
HAProxy may be set to require the cert and key in one single file.
To do that you may need to include a "deploy-hook" - which would combine them and place that file wherever needed.
That said, there may be a way to get HAProxy to use the cert and key files separately.
I don't use HAProxy, so I can't be sure about that - worth looking into though.