vote up 3 vote down star
3

I've got a little private webserver where I have several virtualhosts. I know that it's impossible to assign a certificate to each individual virtualhost, because the server finds out which virtualhost was requested only AFTER the SSL connection has been established. But is it possible to have a single SSL certificate which lists several domains? Or at least a wildcard domain, like *.example.com. If yes, what Linux commands do I have to write to make such a self-signed certificate?

Added: To clarify - I have just one IP address for all the virtual hosts.

flag

44% accept rate

4 Answers

vote up 1 vote down

To expand on AlberT's answer:

http://blog.loftninjas.org/2008/11/11/configuring-ssl-requests-with-subjectaltname-with-openssl/

You don't have to use wildcard domains. You can just list all hostnames you need as subject alt names and it should work on all major browsers.

link|flag
vote up 0 vote down

Create a certificate with domain.com as the CN and *.domain.com in the subjectAltName:dNSName names field - that works.

In openssl, add this to the extensions:

subjectAltName          = DNS:*.domain.com
link|flag
vote up 0 vote down

First of all - you can assign a certificate for each individual virtual host - the key is to make different private (and external/public, if you want to make it world accessible) ip address for each virtualhost.

But then yes - alternatively, you can assign a wildcard certificate if your virtual hosts is simply *.example.com.

For the command - there are many results from google - i'll just put an example from here:

http://www.justinsamuel.com/2006/03/11/howto-create-a-self-signed-wildcard-ssl-certificate/

And make sure you enter *.example.com for the Common Name.

link|flag
That's the point - I have just one IP address. Guess I was unclear on that. – Vilx- Oct 13 at 12:52
@coolwater - Good advice if I'm setting up a production server at work, which would be in our own */16 block*. For those of us with small business connections that only give five static IPs, not really an option. I've dealt with this by limiting myself to five SSL Vhosts, one per IP. – Jason Antman Oct 13 at 22:06
vote up -1 vote down

Hi, Is it also possible to have a self signed wildcard cert for any domain/hostname? Ive tried to use * as the common name but it did not work for me.

Thanks, Vikash.

link|flag
Probably not. And you should start your own question, not post an answer as a question. – Vilx- Oct 14 at 14:27

Your Answer

Get an OpenID
or
never shown

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