Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create a range of hostnames for clients of the format (live|test).(clientname) (e.g. which each have their own separate VirtualHost container and run over HTTPS on Apache. Due to the number of sites and the scarcity of addresses, I can't assign one IPv4 per host, nor can I use Server Name Indication (support in current libraries is almost non-existant), and the number of changes to the hostnames means Subject Alternative Name is also out.

Ideally I'd just have a certificate for *, as that would in theory cover everything, but isn't permitted by RFC 2818. However, since I know that the hostnames will always be of the form * . *, is it possible to create a certificate which contains multiple wildcards to achieve this? I'll be using a self-signed certificate, so it doesn't matter if this isn't something which is offered on a commercial basis, so long as it's technically possible.

share|improve this question
up vote 2 down vote accepted

You can't create certificates with multiple wildcards, it breaks the way certificates are checked.

What you can do however is do * since even if not permitted by RFC 2818 it's the way it'll actually work with most SSL clients.

share|improve this answer
* won't work with most clients - Firefox and IE for starters. – pwaring Jan 19 '11 at 10:47
Well, then I must be wrong, I have a certificate like that working perfectly for those browsers :/ – lynxman Jan 19 '11 at 10:50
Depends on the browser version - FF used to support it and then changed (somewhere in the 3.5.x branch I think). – pwaring Jan 19 '11 at 10:53
It's working for me with Firefox 3.6.8, just double checked right now, but I have to agree with you that using wildcard certificates is a bit of a pain, the browser implementation is poor and gets you diverse results. – lynxman Jan 19 '11 at 11:01

You can't have multiple wildcard characters in the common name, but you can have multiple wildcard Subject Alternative Names. For example, you could add the following SANs:

* * *

However, if you only have two subdomains per client, this only cuts the number of names in half. You could change the naming scheme to be so they would all be covered by one certificate for *

share|improve this answer
The problem with Subject Alternative Names is not the number of entries, but the number of changes - each time I add/remove a client I'd have to change the certificate. I think I'll probably end up going with, which is not as pretty and destroys the hierarchy but should work. – pwaring Jan 19 '11 at 17:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.