Certbot update cert of domain.tld to *.domain.tld and keep paths

I requested a cert for domain.tld but now I realise I need it to be wildcard *.domain.tld
How can I update it to a wildcard cert but still keep same cert file paths ? (without automatically creating 0001 suffixes) ?

I hope I am asking it right, I got really confused by the updates and paths.

I assume you’re using Certbot?

If you add domains, Certbot will offer to use the same directory. For example, if you run β€œcertbot -d example.com” and then β€œcertbot -d example.com -d www.example.com”, it will offer to save it in the example.com directory, replacing the original certificate.

You may want to do that, since a wildcard certificate for *.example.com does not include example.com on its own.

You can also use the --cert-name option to set its name even if it isn’t a superset of an existing certificate. In the example above, you could use β€œcertbot --cert-name example.com -d www.example.com” to get a certificate for www.example.com and save it over your previous example.com certificate.

2 Likes

Thanks for the details. Yes, using certbot.
Not sure how I ended up having many certs with numbers at the end (and not overwrite existent one), I fixed my problem by using same certificate for all servers, this was for multiple cache servers in different countries (same domain).

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.