Strong TLS certificates with acme.sh
384-bit of https
I’m, in absolutely no regards, a security expert. I just fancy shiny new things of the interwebs.
This is why I’ve switched my default TLS certificates to use elliptic curve cryptography (ECC) instead of RSA. Now I have a sweet 100/100 on tls.imirhil.fr
You can learn (far) more by reading this topic and its linked resources.
For automation and ease of use purposes, I’m using acme.sh
# for using standalone mode, you might have to install as sudo curl https://get.acme.sh | sh -s firstname.lastname@example.org
Changing default authority
By default, acme.sh uses ZeroSSL to sign certificates. We need to change this to Let’s Encrypt because according to acme.sh, they’re the only ones offering ECC capabilities.
acme.sh --set-default-ca --server letsencrypt
Using your DNS api
If available, the easiest way to issue a certificate is to use the DNS api of your DNS provider. acme.sh supports a lot of DNS providers.
Define an api key
Follow the docs for your DNS provider, usually:
Issue the cert
acme.sh --issue -d domain.tld --dns dns_provider --keylength ec-384
Using standalone mode
If you don’t have access to the DNS provider, we can use the standalone mode to spin up a temporary web server that will handle all the verifications.
80 must be free.
acme.sh --issue --standalone -d domain.tld --keylength ec-384
Multi domains standalone
acme.sh --issue --standalone -d domain.tld -d www.domain.tld -d subdomain.domain.tld --keylength ec-384
Wildcard domain DNS
acme.sh --issue -d domain.tld -d '*.domain.tld' --dns dns_provider --keylength ec-384
The ECC certificate alone will not grant you a high/perfect score.
Limit TLS version to 1.2 and 1.3 (or just 1.3 as there is only a 5% compatibility gap with 1.2).
Use the strict transport security header.
Strict-Transport-Security: max-age=31536000; includeSubDomains
Use recent and strong ciphers. This is where my knowledge hits its limit… I’m having a really hard time understanding what to use and why.
I’ve based my initial choices of ciphers on this list, cross referencing it with (older?) browser compatibility.
I then asked Aeris, the creator of tls.imirhil.fr, about it and he advised me to use the following:
In order to achieve a perfect score, we can be a little more restrictive with: