VHosts für SSL

Apache, Lighttpd, nginx, Cherokee
Post Reply
hahni
Posts: 165
Joined: 2003-06-20 13:07
Location: Regensburg
Contact:
 

VHosts für SSL

Post 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
pfalzpower
Posts: 90
Joined: 2003-10-28 22:37
Location: Karlsruhe
 

Re: VHosts für SSL

Post 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
hahni
Posts: 165
Joined: 2003-06-20 13:07
Location: Regensburg
Contact:
 

mein Beispiel

Post 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?
hahni
Posts: 165
Joined: 2003-06-20 13:07
Location: Regensburg
Contact:
 

Anmerkung

Post by hahni »

im übrigen haben beide zertifikate 2 verschiedene key-files, die einzeln funktionieren. das darf es doch nicht als grund sein, oder?
pfalzpower
Posts: 90
Joined: 2003-10-28 22:37
Location: Karlsruhe
 

Re: VHosts für SSL

Post 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!
hahni
Posts: 165
Joined: 2003-06-20 13:07
Location: Regensburg
Contact:
 

SSL-VHosts mit IP

Post by hahni »

dort gebe ich die beiden IP's an! jede in einer eigenen VirtualHost-Sektion.

<VirtualHost 123.123.123.123:443>
pfalzpower
Posts: 90
Joined: 2003-10-28 22:37
Location: Karlsruhe
 

Re: VHosts für SSL

Post by pfalzpower »

Poste mal bitte beide Einträge.
Was und wohin leitet die Rewrite Regel?
hahni
Posts: 165
Joined: 2003-06-20 13:07
Location: Regensburg
Contact:
 

rewrite

Post by hahni »

beide einträge sind identisch. die rewrite soll sicherstellen, dass normale seitenaufrufe automatisch auf den ssl-port gelenkt werden.
Post Reply