In my httpd.conf:

If I have my virtual host configured as:


NameVirtualHost *:80

<VirtualHost *:80>
    ServerName foo.com
    ServerAlias www.foo.com
    Include conf.d/foo.conf
</VirtualHost>

<VirtualHost *:80>
    ServerName bar.com
    ServerAlias www.bar.com
    Include conf.d/bar.conf
</VirtualHost>

Can I get by with a single domain SSL certificate or must I purchase a wildcard SSL certificate to handle the www subdomain?

I am now trying to configure the ssl.conf file, can I use name-based vhosts in my ssl.conf file like this:


NameVirtualHost *:443

<VirtualHost *:443>
    ServerName foo.com
    ServerAlias www.foo.com
    ...
    Include conf.d/foo.conf
</VirtualHost>

<VirtualHost *:443>
    ServerName bar.com
    ServerAlias www.bar.com
    ...
    Include conf.d/bar.conf
</VirtualHost>

or do I need IP based vhosts? If this is possible, what kind of cert would I need in order to do this?

link|improve this question

25% accept rate
I reverted my edit. Your question is not a repeat but a near duplicate of a very recent question. serverfault.com/questions/123954/… You might re-write it to clarify your question or delete it if it is redundant. – Warner Mar 18 '10 at 19:13
feedback

3 Answers

up vote 3 down vote accepted

Name based virtual hosts using SSL are possible, but require SNI : http://en.wikipedia.org/wiki/Server_Name_Indication

link|improve this answer
feedback

Depending on the browsers you expect to hit your site, you can use SNI). Otherwise, you need to use IP based vhosts. A self-signed cert will work, but typically a basic SSL cert (about $100, or less) will suffice.

link|improve this answer
feedback

If both sites are on the same IP address, your best option is to use a UC certificate that includes all four names (foo.com, www.foo.com, bar.com, www.bar.com). Then you don't have to worry about SNI which isn't fully supported yet or getting multiple IP addresses or getting a name mismatch error.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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