I attempted to obtain a wildcard SSL certificate, but somehow ended up with individual SSL certificates for each subdomain instead of a wildcard. I followed the documentation, but it didn’t result in a wildcard certificate as expected. Now, each subdomain has its own separate SSL certificate.
I’m using Caddy to automatically obtain free SSL certificates for around 4,000 domains. Occasionally, the JSON file that manages the certificates becomes corrupted, leading to issues like the one mentioned above.
We can’t help with such failure cases without knowing your config (Caddyfile or JSON). Please fill out the help template to ensure we have all the details we need.
I will give you this item. I have now prepared it with certbot, which gives two tokens for this item, which needs to be recorded as a TXT record. I did this. But where does caddy put these two tokens? Or where does it give me to let it confirm to get ssl wildcard?
Different Domain Name Service Providers have different APIs to add, edit, and delete DNS Records.
So using DNS-01 in a practical (automated) way is coupled to which Domain Name Service Provider you are using. Most of the time a plugin is helpful.
First of all, add a space between com and the opening brace, otherwise Caddy cannot know where the site name ends and the block begins
Secondly, you’re adding on_demand, which tells Caddy to keep issuing single SAN certificates and rely on the ask URL to accept or reject the domain name.
Lastly, for wildcard certificates, you need to first remove on_demand and use the DNS challenge which require a custom built Caddy (built with xcaddy command or our download page). You can follow the instructions here:
Caddy’s certificate maintenance is not interactive, it is fully automated.
You cannot configure Caddy to supply a TXT record for you to manually update your DNS provider with.
You must configure Caddy with API access to your DNS provider to do this automatically instead, following the link Mohammed posted should give you the information you need to do this.
But as others have said, you probably don’t need On-Demand TLS if all you’re trying to do is serve subdomains of a domain under your control. In that case, you should use a single wildcard certificate to cover all of them.
Using On-Demand TLS makes the most sense when you have customers pointing their own domains to your server (with a CNAME record pointing to your domain).
If you’re not allowing customers to do that and you’re just doing per-user/customer subdomains under your own domain, then wildcard certificates is what you want.