If you have two different domain names with SSL certificates hosted on one server with one IP address then you will get a warning on the client. Warning is like this: SSL certificate is issued to another domain name. It means that it is not possible to have multiple https virtual hosts on apache web server using one IP address.
If you setup Apache’s VirtualHosts on port 443 on one IP you will get this warning while starting Apache:
[warn] _default_ VirtualHost overlap on port 443, the first has precedence
You can add this line:
This works for multiple domains on one IP on port 80: (in case of warning [warn] _default_ VirtualHost overlap on port 80, the first has precedence):
! BUT in case of port 443 this is not a solution. A client’s browser will still show a warning.
The solution is to get additional IP addresses. One web server can be assigned multiple IP addresses. Find an example how to configure VirtualHosts in Apache to have two domains with SSL below.
Some theory about SSL and connection with web server
HTTPS establishes an SSL connection with the server prior to any HTTP conversation. Since SSL requires a certificate which is linked to the server host name, and the virtual host name hasn’t been transmitted by the client yet, there’s no way short of ESP for the server to tell which SSL certificate to use. But this isn’t an apache server failing so much as a general issue with HTTP/SSL.
Virtual hosts with SSL on Apache web server
This example shows two domains with both 80 and 443 port that will work for http and https.