DEV Community

Cover image for Let's Encrypt: Wildcard Certificate With Certbot

Let's Encrypt: Wildcard Certificate With Certbot

nabbisen on May 04, 2019

* The cover image is originally by OpenClipart-Vectors and edited with great appreciation. Introduction Let's Encrypt supports wildc...
Collapse
 
daniel15 profile image
Daniel Lo Nigro

Would recommend using it along with acme-dns to get auto renewals working. If you use --manual, you'll have to manually renew the certificates every three months. You could use the API provider by your DNS provider (if supported by certbot or acme.sh), but it's not as secure as using acme-dns.

Collapse
 
nabbisen profile image
nabbisen • Edited

Thank you so much, Daniel.
I've found the problem in my solution owing to your advice.
The manual renewal requires a new TXT record every three months:
community.letsencrypt.org/t/how-to...
Nice Go OSS 😆

I updated my post.
Thank you, again!

Collapse
 
dineshrathee12 profile image
Dinesh Rathee

LetsEncrypt have revoked around 3 million certs last night due to a bug that they found. Are you impacted by this, Check out ?

DevTo
[+] dev.to/dineshrathee12/letsencrypt-...

GitHub
[+] github.com/dineshrathee12/Let-s-En...

LetsEncryptCommunity
[+] community.letsencrypt.org/t/letsen...

Collapse
 
michaelking1832 profile image
MichaelKing1832

Just curious. What is your use case for needing a wildcard cert?

Collapse
 
abrahambrookes profile image
Abraham Brookes

I have a white label app that uses a subdomain to distinguish different brands - "coke.app.com" "pepsi.app.com" etc. Needs a wildcard cert to secure them all so we can add new subdomains whenever we want and not get ssl errors.

Collapse
 
ajxn profile image
Anders Jackson • Edited

Running different servers. Like www. domain and domain as web servers and jabber.domain and domain as jabber servers.
For instance.

Collapse
 
michaelking1832 profile image
MichaelKing1832

You really shouldn't mix/combine the security of completely different services (thats what a certificate is - service identity) in a single certificate. The proper solution is to up the automation surrounding your service's build process to include the asynchronous process of obtaining a certificate for each service.

If you need multiple hostnames for the same certificate (AND KEYPAIR), you should be using SAN certificates, not wildcards.

If you need multiple endpoints with the same DNS hostname, you make that a common SAN across multiple certs for each individual TLS endpoint.

Thread Thread
 
michaelking1832 profile image
MichaelKing1832 • Edited

As a follow-up, IMO, the only valid use case for wild card certs is for self-contained private PKIs usedd internally with external certs for the exposed service endpoints. An example would be a private mini-CA dedicated (and trusted) only for inter-node internal connections within the cluster.

Thread Thread
 
nabbisen profile image
nabbisen

Dear MichaelKing1832
Thank you for your description and follow-up.
I'm so grateful to you 🙂
I'll learn and get experienced much more...

Collapse
 
jacobmparis profile image
Jacob Paris • Edited

The main shortcoming of LetsEncrypt is that it's faster to renew my certificates than it is to write a CRON job to do it every three months, so years later I'm still doing them all manually

Collapse
 
kr0nt4b profile image
Klaus Schüssler

That seems more your shortcoming.
;) It isnt that hard to write such a cronjob, is it?

Collapse
 
elmuerte profile image
Michiel Hendriks

Certbot, the primary acme client, does this out of the box.

Collapse
 
jacobmparis profile image
Jacob Paris

Not at all! But it's even less hard to not write one

Thread Thread
 
nabbisen profile image
nabbisen

Actually, I update manually now, too. Haha 😆
certbot renew is useful.
Well, I'll add a simple cron job in the near future, although automatic renewal without any writing is also my ideal... 🙂

Collapse
 
plantroon profile image
Jakub Fiľo

I would recommend using acme.sh script instead of certbot. Way less dependencies and way easier.

I wrote about it on my blog. (just search for plantroon blog if you're interested)

Collapse
 
daniel15 profile image
Daniel Lo Nigro

certbot is in the repository of most Linux distros... At least on Debian you can simply apt install certbot so it's actually easier to install than acme.sh is :)

Both are good options though!

Collapse
 
michaelangelozzi profile image
run_the_race

Not true anymore, you are required to snapd install it.

Thread Thread
 
daniel15 profile image
Daniel Lo Nigro

I'm not sure about that... It's still in the Debian repos.

Collapse
 
plantroon profile image
Jakub Fiľo

That's true. But acme.sh is just one script to download, you don't really have to install it. I keep it in ~/.local/bin or /usr/local/bin on my systems. You need to supply hook scripts though, but that is required for Certbot too.

Collapse
 
nabbisen profile image
nabbisen

Thank you, Jakub, for your good information.
I found that (perhaps):
github.com/Neilpang/acme.sh
I haven't ever known of it since you told me 😀

Collapse
 
varunbatrait profile image
Varun Batra

You can use docker. Docker and Wild card ssl

Collapse
 
nabbisen profile image
nabbisen

Thank you for your good information.
While I use OpenBSD servers and thus am unfamiliar with using docker, it seems to enable us almost anything ☺️