Page 1 of 1

VHosts für SSL

Posted: 2005-01-07 22:58
by hahni
hallo zusammen,

hat jemand ein beispiel für einen vhost-eintrag, wenn es sich um eine ssl-präsenz handelt.

es sollen mehrere ssl-vhosts nebeneinander existieren können. allerdings mit verschiedenen ip's!

vielen dank für eure hoffentlich zahlreichen tipps!

beste grüße

björn

Re: VHosts für SSL

Posted: 2005-01-08 13:05
by pfalzpower
simples Beispiel mal im Netz gefunden

Code: Select all

<VirtualHost 123.123.123.123:443>
DocumentRoot /pfad/zum/docroot/
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL 
SSLCertificateKeyFile /pfad/zum/zertifikat.key
SSLCertificateFile /pfad/zum/zertifikat.crt
</VirtualHost>
Die anderen Optionen (Servername, Logfiles, suExex, etc) wie gewohnt setzen

mein Beispiel

Posted: 2005-01-08 16:30
by hahni
hatte vorher immer folgende vhosts gesetzt:

---
<VirtualHost xyz>
RewriteEngine on
RewriteRule ^/(.*) https://www.xyz.de [R]
</VirtualHost>

<VirtualHost xyz:443>
ServerAlias xyz.de http://www.xyz.de
DocumentRoot /home/web/domains/xyz.de/htdocs
ScriptAlias /cgi-bin/ /home/web/domains/xyz.de/htdocs/cgi-bin/
TransferLog /home/web/domains/xyz.de/logs/access.log
ErrorLog /home/web/domains/xyz.de/logs/error.log

SSLEngine on
SSLCertificateFile /etc/httpd/ssl.crt/xyz.de.crt
SSLCertificateKeyFile /etc/httpd/ssl.key/xyz.de.key
BrowserMatch MSIE ssl-unclean-shutdown nokeepalive downgrade-1.0 force-response-1.0
</VirtualHost>
---

leider funktioniert das nur beim ersten zertifikat. wo liegt denn da wirklich der hase begraben?

Anmerkung

Posted: 2005-01-08 16:31
by hahni
im übrigen haben beide zertifikate 2 verschiedene key-files, die einzeln funktionieren. das darf es doch nicht als grund sein, oder?

Re: VHosts für SSL

Posted: 2005-01-08 17:07
by pfalzpower
Bei deinem VirtualHost Aufruf, ist xyz der Domainname oder die IP-Adresse?
Why can't I use SSL with name-based/non-IP-based virtual hosts?

The reason is very technical. Actually it's some sort of a chicken and egg problem: The SSL protocol layer stays below the HTTP protocol layer and encapsulates HTTP. When an SSL connection (HTTPS) is established Apache/mod_ssl has to negotiate the SSL protocol parameters with the client. For this mod_ssl has to consult the configuration of the virtual server (for instance it has to look for the cipher suite, the server certificate, etc.). But in order to dispatch to the correct virtual server Apache has to know the Host HTTP header field. For this the HTTP request header has to be read. This cannot be done before the SSL handshake is finished. But the information is already needed at the SSL handshake phase. Bingo!

SSL-VHosts mit IP

Posted: 2005-01-08 17:20
by hahni
dort gebe ich die beiden IP's an! jede in einer eigenen VirtualHost-Sektion.

<VirtualHost 123.123.123.123:443>

Re: VHosts für SSL

Posted: 2005-01-08 22:13
by pfalzpower
Poste mal bitte beide Einträge.
Was und wohin leitet die Rewrite Regel?

rewrite

Posted: 2005-01-08 22:17
by hahni
beide einträge sind identisch. die rewrite soll sicherstellen, dass normale seitenaufrufe automatisch auf den ssl-port gelenkt werden.