I have foo.es site with a SSL wildcard certificate running since 2 years ago. Now I want to install another certificate for "**.foo.com*" in the same server. I've copied the new foo_com.crt and foo_com.key files to the new server and have added a new entry to ssl.conf:
<VirtualHost foo.com:443>
ServerAdmin [email protected]
DocumentRoot /var/www/foo.com/
Servername foo.com
ServerAlias www.foo.com
ErrorLog /usr/local/apache/logs/error_log
TransferLog /usr/local/apache/logs/access_log
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/httpd/ssl.crt/foo_com.crt
SSLCertificateKeyFile /etc/httpd/ssl.key/foo_com.key
SSLCertificateChainFile /etc/httpd/ca/sub.class2.server.ca.pem
SSLCACertificateFile /etc/httpd/ca/ca.pem
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog /usr/local/apache/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
With this, I expected to access to https://foo.com without any problem. Instead, the browser warns with a ssl_error_bad_cert_domain error code. When I've seen the certificate I found that the certificate common name is **.foo.es*, it is, the first certificate (note that I still have this certificate installed, I need both).
Apache error log says only this:
[Wed Jan 23 22:53:56 2013] [warn] RSA server certificate CommonName (CN) `*.foo.com' does NOT match server name!?
[Wed Jan 23 22:53:56 2013] [warn] RSA server certificate CommonName (CN) `*.foo.com' does NOT match server name!?
[Wed Jan 23 22:53:56 2013] [warn] RSA server certificate CommonName (CN) `*.foo.com' does NOT match server name!?
[Wed Jan 23 22:53:56 2013] [warn] RSA server certificate wildcard CommonName (CN) `*.foo.com' does NOT match server name!?
[Wed Jan 23 22:53:56 2013] [warn] RSA server certificate CommonName (CN) `*.foo.com' does NOT match server name!?
[Wed Jan 23 22:53:56 2013] [warn] RSA server certificate CommonName (CN) `*.foo.com' does NOT match server name!?
[Wed Jan 23 22:53:56 2013] [warn] RSA server certificate CommonName (CN) `*.foo.com' does NOT match server name!?
[Wed Jan 23 22:53:56 2013] [warn] RSA server certificate wildcard CommonName (CN) `*.foo.com' does NOT match server name!?
What's happening? Why the browser gets the foo.es certificate but the Apache log reports a problem with the foo.com cert?
Running: Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.8g on a Gentoo distro