I'm afraid it's not possible to fulfill all your requirements with tomcat:
- multiple domains
- two SSL certificates
- unique IP address
- standard SSL port (I have assumed it)
Tomcat SSL Configuration is defined in <Connector>
element at config.xml
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>
Each connector requires a port
attribute. See definition in HTTP Connector documentation
The TCP port number on which this Connector will create a server socket and await incoming connections. Your operating system will allow only one server application to listen to a particular port number on a particular IP address.
Therefore you can't define two connectors using the same port, and then it is not possible to configure different SSL certificates.
Alternatives
Several IP's: The address
attribute configures which address will be used for listening on the specified port. Set an IP per main domain using a SSL certificate and configure a Connector
for it
Different ports: 443
for *.abc.com, 444
for *.def.com, and so on
SSL Proxy: Deploy a proxy server like Apache or Nginx in front of tomcat. The proxy only deals with SSL negotiation and virtual hosts. All the traffic is redirected to Tomcat in plain HTTP.
Just as an example using Apache mod_ssl + and the tomcat connector mod_JK your requested configuration is simple
listen 443
<VirtualHost *:443>
ServerName a.abc.com:443
SSLEngine on
SSLProtocol all -SSLv2
SSLCertificateFile "/home/certs/abc.com.crt"
SSLCertificateKeyFile "/home/certs/abc.com.key"
SSLCertificateChainFile "/home/certs/abc.com.ca-bundle"
SSLOptions +StdEnvVars +ExportCertData
ErrorLog "/var/logs/error_abc_443.log"
TransferLog "/var/logs/error_abc_443.log"
JkMount /* worker1
</VirtualHost>
<VirtualHost *:443>
ServerName c.def.com:443
SSLEngine on
SSLProtocol all -SSLv2
SSLCertificateFile "/home/certs/def.com.crt"
SSLCertificateKeyFile "/home/certs/def.com.key"
SSLCertificateChainFile "/home/certs/def.com.ca-bundle"
SSLOptions +StdEnvVars +ExportCertData
ErrorLog "/var/logs/error_def.log"
TransferLog "/var/logs/error_def.log"
JkMount /* worker2
</VirtualHost>