Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 used make-dummmy-cert that comes with apache 2.2 and ssl_mod to make a self-signed certificate. I tried making it for,, or *, but none of them would work for both and The browser would say The certificate is only valid for (or or * respectively)

How do I make a self-signed cert that would work for both cases?

share|improve this question

* won't match because the star only matches subdomains of * will however match and

What I think you need to do if you really want to match both is to create a certificate with multiple CNs entries in the SubjectAltName, one for and one for * (or, if you don't need to match any other subdomains). This link might help:


@Bill Weiss is right, I just checked one of the certs I have from GoDaddy and it has both and in the SubjectAltName, and both work in the browser. So it sounds like you can get what you need for cheap.

Good luck,


share|improve this answer
I am going to get a commercial certificate with multiple CNs, any suggestions that are cheap and decent? – user12145 Apr 14 '10 at 21:06
@user12145 Wildcard certificates aren't cheap at all, but the cheapest I've found have been through's certificate service. – Jed Daniels Apr 14 '10 at 21:09
but wildcard certificates won't work for right? I don't need to match subdomains. – user12145 Apr 14 '10 at 21:13
GoDaddy will throw in a SubjectAltName for At least, that's been my experience. Talk to your CA about it, they'll help you. – Bill Weiss Apr 14 '10 at 21:53
Other providers also add a free SubjectAltName: Comodo, DigiCert, and GlobalSign – Robert Apr 15 '10 at 15:19

Do you have the same content at and As far as I understand this would be a bad idea for SEO and you should redirect one to the other using for instance mod_rewrite.

share|improve this answer
You'd still need SSL for both, or someone visiting the redirect URL via HTTPS will still get the certificate mismatch. – ceejayoz Jan 30 '13 at 17:35

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.