One precision: I restarted apache, and the following warning was issued:
[Tue May 29 20:30:43 2012] [warn] VirtualHost x.x.x.x:443 overlaps with VirtualHost x.x.x.x:443, the first has precedence, perhaps you need a NameVirtualHost directive
Where x.x.x.x is the same ip address
I believe that’s the apache config produced by virtualmin that’s missing the NameVirtualHost directive…
We’re running VirtualMin Pro 3.92 (installed 12/May/2012)
I confirm this is something to polish in virtualmin. For those of us who want to do SNI, we need to modify the apache directives manually (yay)
But I got it working
If you want to get SNI to work on Virtualmin, it’s a three step process:
modify the /etc/apache2/apache2.conf file and make sure you have at least one line like this:
NameVirtualHost *:443
modify your virtualhosts in /etc/apache2/abc.com.conf (and all other .conf sharing the same ip) by changing the 443 virtualhost line to:
VirtualHost *:443 (with the enclosing < and > tags)
restart apache.
Works like a charm. Oh, but yeah, anyone with a browser for whom SNI does not work will get an SSL certificate error even though the right site will show - but I don’t think it should be a huge deal, Windows XP is down to 27% and it’s loosing 1.5% almost every month.
For customers being turned off, we as web companie can instruct them to upgrade their browser, or accept the certificate error.
Use OpenSSL 0.9.8f or later
Build OpenSSL with the TLS Extensions option enabled (option enable-tlsext; OpenSSL 0.9.8k and later has this enabled by default).
Apache must have been built with that OpenSSL (./configure --with-ssl=/path/to/your/openssl). In that case, mod_ssl will automatically detect the availability of the TLS extensions and support SNI.
Apache must use that OpenSSL at run-time, which might require setting LD_LIBRARY_PATH or equivalent to point to that OpenSSL, maybe in bin/envvars. (You’ll get unresolved symbol errors at Apache startup if Apache was built with SNI but isn’t finding the right openssl libraries at run-time.)
How can you tell if your Apache build supports SNI? If you configure multiple name-based virtual hosts for an address where SSL is configured, and SNI isn’t built into your Apache, then upon Apache startup a message like “You should not use name-based virtual hosts in conjunction with SSL!!” will occur in the error log. If SNI is built in, then the error log will show “[warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)”.
I tried to enable SSL on a 2nd top-level virtual server / website. Previously only the parent site (same Virtualmin install) had SSL enabled.
Reissued fresh certificates
Added the .crt (certificate) file
Added the .ca-bundle (certificate authority) file
After I did this I got locked out of Virtualmin, since the parent website’s SSL got updated with the new cert mismatch. How can I avoid the parent virtual server sporting the secondary certificate?
We can certainly help out, but since this thread is over 3 years old – could you start a new thread, and there, describe the issue that’s occurring now? Thanks!