I'm working on a site that provides bespoke websites to franchisees of a large organization. Each franchisee is managed as a separate sub-domain and everything is handled by one set of servers, which parse off the sub-domain name, and then based on that, serve up the properly composed pages so that the overall site has standard branding, but portions of the page are customized for each franchisee. So if the root domain is "delivery.com" for example, then a certain franchisee might have "newyork.delivery.com" as their unique domain, and another might be "chicago.delivery.com". All of the sites are served by a single server (maybe load-balanced multiple servers) that uses the "newyork" or "chicago" subdomain to serve similar but different sites depending on which url you ask for. To avoid having to come up with separate DNS entries for everything, we are using a wildcard DNS entry for "*.delivery.com" pointing to the single server (or loadbalancer). Slick!
In order to provide SSL for this system, we went and asked for a wildcard SSL Certificate for "*.delivery.com" and that seems to have been wonderful except for one thing... if somebody accidentally types in "www.newyork.delivery.com" they get told that there's no SSL certificate and rather alarmingly that someone may be spoofing them for nefarious purposes! Certainly not the type of messaging that's desired. So the DNS lookup for "www.newyork.delivery.com" correctly resolves to our server, but before my code even gets executed on the server, the browser determines that the wildcard SSL certificate we have doesn't cover a 2nd level subdomain, and displays an error to the user. So, as it turns out, for DNS entries "*.delivery.com" means "anything under the delivery.com domain, including multiple layers of subdomains". But when asking for an SSL certificate, "*.delivery.com" means "one-level of subdomain only". How do I ask for an SSL certificate that provides protection for an entire domain, including all of the subdomains (multiple levels deep) beneath that domain? Barring that, it seems like my only solution would be to create CNAME entries for each of the fully-qualified subdomains I want to support, and then at least the error to the browser would be the less alarming "site not found" error. Any other solutions would be appreciated!