Glossary / wildcard certificate
What is a wildcard certificate
A wildcard certificate is an SSL certificate that covers all subdomains of a domain on one level at once. The domain itself is not covered by the wildcard and is usually added to the same certificate as a separate name. One certificate for *.example.com replaces separate certificates for shop, blog and mail. It is convenient when a site has many subdomains or adds new ones often.
Check your site
The name field of the certificate holds an asterisk: *.example.com. The asterisk matches any single subdomain name, so www.example.com, shop.example.com and api.example.com all fit the same certificate.
The asterisk covers only one level. *.example.com secures shop.example.com but not app.shop.example.com, and deeper levels need their own wildcard or a multi-domain certificate.
Wildcards are usually issued through DNS validation: you add a special TXT record to the domain's zone. Let's Encrypt, which is free, issues wildcards too, but only through DNS validation.
Because one certificate serves every subdomain, a leak of its private key exposes all of them at once.
Example
*.example.com
Common mistakes
- Expecting *.example.com to cover the bare example.com as well. The bare domain often has to be added to the same certificate separately.
- Assuming a wildcard covers every level of subdomains. It works only one level down.
- Putting the same wildcard key on many servers without need: if the key leaks, the whole domain is compromised.
- Paying for a wildcard when Let's Encrypt issues one for free through DNS validation.