simgel
Goto Top

Apache Zertifiakt Cache

Ich habe für einen VirtualHost ein neues Zertifiakt generiert, aber es wird das alte ausgeliefert.

Hallo,

Ich hatte ein Problem mit SVN über https. Nach ein paar Minuten Recherche habe ich herausgefunden dass ich den CN (ComonName) vergessen hatte.

Also hab ich einfach das alte Zertifikat auf meinem Server gelöscht und eine neues mit dem gleichen Namen erzeugt. Als ich dann immernoch die gleiche Fehlermeldung erhalten habe, habe ich mir das Zertifikat im Browser anzeigen lassen und habe festgestellt das es sich um das alte Zertifikat handelt.
Ich hab mir das Zertifikat dann an verschiednen Computern anzeigen lassen und hab überall das alte Zertifikat erhalten. Daher muss der Server ja das falsche Zertifikat benutzen.

Ein paar technische infos:
Es handelt sich um ein Debian 5.0 mit aktuellem Apache2. Das Ding steht bei Server4You.
Die Zertifikate sind selbst-signiert.

Die Config des VirtualHost:
NameVirtualHost *:443

<VirtualHost *:443>
        ServerName svn.meinhost
        ErrorLog /var/log/apache2/error.log

        SSLEngine on
        SSLCertificateKeyFile /srv/cert/svn.meinhost.pubkey.pem
        SSLCertificateFile /srv/cert/svn.meinhost.cert.crt

        <Location / >
                Order allow,deny
                Allow from all
                DAV svn
                SVNPath /srv/svn/meinhost

                AuthType Basic
                AuthName "Svn"  
                AuthUserFile /srv/auth/svn.meinhost.de
                Require valid-user

        </Location>
</VirtualHost>

Die Zertifiakte erstelle ich mit folgendem Script:
#!/bin/bash
NAME=$1

PRIVATEKEY=$NAME.privkey.pem
PUBLICKEY=$NAME.pubkey.pem
CSRFILE=$NAME.cert.csr
CRTFILE=$NAME.cert.crt

`openssl genrsa -out $PRIVATEKEY 1024`
`openssl rsa -in $PRIVATEKEY -out $PUBLICKEY`
`openssl req -new -key $PRIVATEKEY -out $CSRFILE`
`openssl x509 -in $CSRFILE -req -signkey $PUBLICKEY -days 9999 -out $CRTFILE`


Hat jemand eine Idee was ich falsch gemacht habe?

Content-Key: 142836

Url: https://administrator.de/contentid/142836

Printed on: April 25, 2024 at 23:04 o'clock

Member: dog
dog May 15, 2010 at 01:55:39 (UTC)
Goto Top
Hat jemand eine Idee was ich falsch gemacht habe?

Den Apache nicht neu gestartet?
Member: simgel
simgel May 15, 2010 at 08:31:21 (UTC)
Goto Top
Habe ich breits mehrmals versucht. Ich hab auch den Server schon mehrmals neu gestartet. Hat aber alles nix gebracht.

Gibt es evtl. eine Konfiguration, die dafür sorgt das die Zertifikate gecached werden?

Dies ist meine ssl.conf vom apache:
<IfModule mod_ssl.c>
#
# Pseudo Random Number Generator (PRNG):
# Configure one or more sources to seed the PRNG of the SSL library.
# The seed data should be of good random quality.
# WARNING! On some platforms /dev/random blocks if not enough entropy
# is available. This means you then cannot use the /dev/random device
# because it would lead to very long connection times (as long as
# it requires to make more entropy available). But usually those
# platforms additionally provide a /dev/urandom device which doesn't  
# block. So, if available, use this one instead. Read the mod_ssl User
# Manual for more details.
#
SSLRandomSeed startup builtin
SSLRandomSeed startup file:/dev/urandom 512
SSLRandomSeed connect builtin
SSLRandomSeed connect file:/dev/urandom 512

##
##  SSL Global Context
##
##  All SSL configuration in this context applies both to
##  the main server and all SSL-enabled virtual hosts.
##

#
#   Some MIME-types for downloading Certificates and CRLs
#
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl

#   Pass Phrase Dialog:
#   Configure the pass phrase gathering process.
#   The filtering dialog program (`builtin' is a internal  
#   terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog  builtin

#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism
#   to use and second the expiring timeout (in seconds).
#SSLSessionCache         dbm:/var/run/apache2/ssl_scache
SSLSessionCache        shmcb:/var/run/apache2/ssl_scache(512000)
SSLSessionCacheTimeout  300

#   Semaphore:
#   Configure the path to the mutual exclusion semaphore the
#   SSL engine uses internally for inter-process synchronization.
SSLMutex  file:/var/run/apache2/ssl_mutex

#   SSL Cipher Suite:
#   List the ciphers that the client is permitted to negotiate.
#   See the mod_ssl documentation for a complete list.
#   enable only secure ciphers:
SSLCipherSuite HIGH:MEDIUM:!ADH
#   Use this instead if you want to allow cipher upgrades via SGC facility.
#   In this case you also have to use something like
#        SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
#   see http://httpd.apache.org/docs/2.2/ssl/ssl_howto.html.en#upgradeenc
#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

# enable only secure protocols: SSLv3 and TLSv1, but not SSLv2
SSLProtocol all -SSLv2

</IfModule>
Member: simgel
simgel May 16, 2010 at 16:34:52 (UTC)
Goto Top
Ok, ich hab das Problem gelöst.

Es wurde ein anderes Zertifiakt vom Apache genutzt.
Ich bin davon ausgegangen, das man verschiedene VirtualHosts mit verschiedenen Zertifikaten erstellen kann. Das geht derzeit "noch" nicht. Daher hat der Apache das erste konfigurierte Zertifikat benutzt, welches nicht das war was ich ändern wollte.

Es gibt eine Erweiterung(SNI) für den Apache mit der es möglich ist mehrere Zertifikate für verschiedene Hosts zu benutzen. Blöderweise funktioniert das nich mit allen Browsern.
Zum Thema SNI : http://de.wikipedia.org/wiki/Server_Name_Indication

Ich danke euch trotzdem für eure Mühen.

Gruß
SimGel