ich hab ein Problem mit Apache2 und SSL. Hab zwar schonmal gesucht aber nichts auf mein kurioses Problem gefunden. Vielleicht ist einem von euch das ebenfalls bekannt.
Ich nutze auf meinem Server Confixx und selbst erzeugte Zertifikate, ebenso auch von offiziellen Zertifizierungsstellen.
Habe also folgendes Problem: Beim manuellen eintragen eines VirtualHost wird immer nur das SSL Zertifikat genommen welches im ersten VirtualHost angegeben wurde und überschreibt somit alle anderen und heißt dann natürlich das der CN falsch ist. Nicht aber wenn es über Confixx eingegebenes von einem öffentlichen CA verifiziertes Zertifikat eingetragen wurde. Das erhält in seinem eigenen VirtualHost scheinbar immer die Oberhand.
Zur verdeutlichung ein auszug aus meiner manuellen Conf:
Code: Select all
## SVN
<VirtualHost xxx.xxx.xxx.xxx:443>
ServerAdmin admin@mail.adresse
ServerName svn.domain.de
<IfModule mod_ssl.c>
SSLEngine on
SSLCertificateKeyFile /etc/ssl.key/svn.domain.de.key
SSLCertificateFile /etc/ssl.crt/svn.domain.de.crt
SetEnvIf User-Agent ".*MSIE.*"
nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
<Files ~ ".(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
</IfModule>
<Location />
DAV svn
SVNParentPath /srv/svn
SSLRequireSSL
AuthType Basic
AuthName "Subversion"
AuthUserFile /srv/svn/conf/svnpasswd
AuthzSVNAccessFile /srv/svn/conf/svnaccessfile
Require valid-user
ErrorDocument 404 default
</Location>
ErrorLog /var/log/apache2/svn.domain.de_error.log
CustomLog /var/log/apache2/svn.domain.de_access.log Combined
</VirtualHost>
## Horde
<VirtualHost xxx.xxx.xxx.xxx:443>
ServerName horde.domain.de
DocumentRoot /srv/www/horde
ErrorLog /var/log/apache2/horde.domain.de/error_ssl.log
CustomLog /var/log/apache2/horde.domain.de/access_ssl.log Combined
php_admin_flag safe_mode Off
php_admin_value include_path ".:/usr/share/php:/bin:/usr/bin"
<IfModule mod_ssl.c>
SSLEngine on
SSLCertificateKeyFile /etc/ssl.key/server.key
SSLCertificateFile /etc/ssl.crt/domain.de.crt
SetEnvIf User-Agent ".*MSIE.*"
nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
<Files ~ ".(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
</IfModule>
</VirtualHost>
Code: Select all
<VirtualHost xxx.xxx.xxx.xxx:443>
ServerName confixx.domain2.de
DocumentRoot /srv/www/confixx/html
...
<IfModule mod_ssl.c>
SSLEngine on
SSLCertificateKeyFile /etc/ssl.key/server.key
SSLCertificateFile /etc/ssl.crt/domain2.de.crt
SetEnvIf User-Agent ".*MSIE.*"
nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
<Files ~ ".(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/srv/www/confixx/html/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
</IfModule>
CustomLog /var/log/apache2/confixx.domain2.de_access.ssl.log "%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i""
ErrorLog /var/log/apache2/confixx.domain2.de_error.ssl.log
</VirtualHost>
Generell wird meine Config erst nach der confixx_mhost.conf bzw. den confixx_vhosts. Dann wird bei allen Domains die in meiner Config drin sind das Cert von confixx genommen, also mit dem CN confixx.domain2.de, anstatt z.B. das Wildcard CN *.domain.de wie es für horde.domain.de definiert ist.
Aber wenn ich nun den Spieß umdrehe und zuerst meine Config lade, wird die confixx.domain2.de ebenso wie die horde.domain.de mit dem Zertifikat von svn.domain.de überschrieben.
Von all dem schein aber der VirtualHost mit dem offiziellen Zertifikat nicht beeindruckt zu sein und macht sein eigenes Ding (richtig). Hier noch zur Vervollständigung das was immer funktioniert:
Code: Select all
<VirtualHost xxx.xxx.yyy.yyy:443>
ServerName ssl.domain3.de
DocumentRoot /srv/www/web23/html
SuexecUserGroup web23 web23
ScriptAlias /cgi-bin/ /srv/www/web23/html/cgi-bin/
<IfModule mod_python.c>
<Files ~ ".py$">
AddHandler python-program .py
PythonHandler mod_python.publisher
</Files>
</IfModule>
php_admin_value open_basedir /srv/www/web23/html/:/srv/www/web23/phptmp/:/srv/www/web23/files/:/srv/www/web23/atd/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /srv/www/web23/phptmp/
<IfModule mod_ssl.c>
SSLEngine on
SSLCertificateKeyFile /etc/ssl.key/web23.key
SSLCertificateFile /etc/ssl.crt/web23.crt
SetEnvIf User-Agent ".*MSIE.*"
nokeepalive ssl-unclean-shutdown
downgrade-1.0 force-response-1.0
SSLCertificateChainFile /etc/ssl.crt/ca-web23.crt
<Files ~ ".(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/srv/www/web23/html/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
</IfModule>
</VirtualHost>
Nun sagt mir aber bitte das es nicht wirklich daran liegt das jeder SSL-Eintrag eine eigene IP benötigt. ;-)
Vielen Dank!