2

Can I use a single certificate for two domains which are hosted on the same VPS that is using one IP address?

Wesley
  • 32,320
  • 9
  • 80
  • 116
firephil
  • 149
  • 1
  • 1
  • 8

3 Answers3

4

Use the NameVirtualHost directive :

NameVirtualHost *:443

define your vhosts:

<VirtualHost *:443>
  ServerName www.studyhat.blogspot.com
  DocumentRoot "/opt/apache22/htdocs/siteA"
  SSLCertificateFile "/path/to/my/cert"
  SSLCertificateKeyFile "/path/to/my/key"
</VirtualHost>
<VirtualHost *:443>
  ServerName www.studyhat.wordpress.com
  DocumentRoot "/opt/apache22/htdocs/siteB"
  SSLCertificateFile "/path/to/my/cert"
  SSLCertificateKeyFile "/path/to/my/key"
</VirtualHost>
neolix
  • 518
  • 7
  • 20
3

Yes it is possible. This is called a Unified Communication Certificate. Refer to this wikipedia article.

Lucas Kauffman
  • 16,818
  • 9
  • 57
  • 92
  • I was about to answer no, citing the TLS handshake occuring prior to the http request being made, those UC certs are new on me, thanks for the info. – Oneiroi Mar 19 '12 at 16:44
  • @Oneiroi Even without subject alternate names or a wildcard cert, there's a widely deployed TLS extension to indicate hostname. – Shane Madden Mar 20 '12 at 01:20
0

As detailed in this answer, you essentially get 3 options:

  • Using a wildcard certificate: a certificate issued for *.example.com that would match www1.example.com and www2.example.com. Beware *.example.com will not match example.com. In addition, their usage is generally discouraged (see RFC 6215).
  • Using a certificate with multiple Subject Alternative Name entries. There should be one entry per host. This is generally widely supported. How they're called commercially will depend on the CA (they're sometimes called UCC).
  • Using multiple certificates via the Server Name Indication extension (allowing you to have multiple VirtualHost *:443 with distinct ServerNames and SSLCertificate configuration). This is not supported for any version of IE on Windows XP and may cause problem with some mobile browsers too.
Bruno
  • 4,069
  • 1
  • 20
  • 37