GNUTLSClientVerify blockiert keine nicht erkannten CAs

GNUTLSClientVerify blockiert keine nicht erkannten CAs

Ich habe Apache auf Ubuntu installiert, das GNUTLS-Modul installiert und alles hat gut funktioniert:

root@ilnwad15:~# apache2 -v
Server version: Apache/2.2.22 (Ubuntu)
Server built:   Jul 12 2013 13:37:15

Nun möchte ich, dass Port 1443 blockiert wird, wenn die CA des Client-Zertifikats nicht die CA auf meinem Server ist.

So habe ich es in /etc/apache2/apache2.conf konfiguriert

Listen *:443
Listen *:1443
<VirtualHost *:443>
    GnuTLSEnable on
    GnuTLSKeyFile  /etc/apache2/certs/ilnwad15.tlv.sap.corp.key
    GnuTLSCertificateFile  /etc/apache2/certs/ilnwad15.tlv.sap.corp.crt
    DocumentRoot /disk2/var/www/html
    GnuTLSPriorities EXPORT
    ServerName      ilnwad15
</VirtualHost>

<VirtualHost *:1443>
    GnuTLSEnable on
    GnuTLSKeyFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.key
    GnuTLSCertificateFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.crt
    GnuTLSPriorities EXPORT
    GnuTLSClientCAFile /etc/apache2/certs/ca.pem
    GNUTLSClientVerify require
    DocumentRoot /disk2/var/www/html
    ServerName ilnwad15
</VirtualHost>

Was jetzt passiert, ist, dass beim Senden einer Anfrage ohne Zertifikat ein interner Fehler auftritt.

[root@ilnwadv56 ~]# wget --save-headers --no-check-certificate HTTPs://ilnwad15.tlv.sap.corp:1443
--2013-12-18 17:23:01--  https://ilnwad15.tlv.sap.corp:1443/
Resolving ilnwadv62... 172.16.162.21
Connecting to ilnwadv62|172.16.162.21|:18080... connected.
WARNING: cannot verify ilnwad15.tlv.sap.corp's certificate, issued by `/C=IL/L=Raanana/O=SAP/OU=AccAD/CN=Dummy device':
Unable to locally verify the issuer's authority.
WARNING: certificate common name `dummy.service.com' doesn't match requested host name `ilnwad15.tlv.sap.corp'.
Proxy request sent, awaiting response... 500 Server Error
2013-12-18 17:23:01 ERROR 500: Server Error.

Wenn die Anforderung jedoch ein Zertifikat enthält, dessen CA nicht mit der Server-CA übereinstimmt, erhalte ich 200 OK Internet Explorerund keine 403 Forbidden. Wenn ich dies tue, wgeterhalte ich diefailed: Service Unavailable to establish SSL connection.

[root@ilnwadv56 ~]# wget --save-headers --no-check-certificate --certificate=/sapmnt/accad/other/client.crt --private-key=/sapmnt/accad/other/client.key HTTPs://ilnwad15.tlv.sap.corp:443
--2013-12-18 17:46:17--  https://ilnwad15.tlv.sap.corp/
Resolving ilnwadv62... 172.16.162.21
Connecting to ilnwadv62|172.16.162.21|:18080... connected.
Proxy tunneling failed: Service UnavailableUnable to establish SSL connection.

Hat jemand eine Idee, wo mein Fehler liegt? Vielen Dank im Voraus.

Antwort1

OK, zunächst einmal danke an alle, die versucht haben zu helfen (insbesondere an @MadHatter). Das Problem war, dass ich einen Proxy verwendet habe, also musste ich es tun unset https_proxyund das Problem wurde gelöst.

Im Moment funktioniert es einwandfrei. Beim Senden eines Dummy-Zertifikats (indem kein Zertifikat übermittelt wird wget)

wget --save-headers --no-check-certificate HTTPS://ilnwad15.tlv.sap.corp:1443
--2013-12-22 10:37:02--  https://ilnwad15.tlv.sap.corp:1443/
Resolving ilnwad15.tlv.sap.corp... 172.16.60.21
Connecting to ilnwad15.tlv.sap.corp|172.16.60.21|:1443... connected.
OpenSSL: error:1409442F:SSL routines:SSL3_READ_BYTES:tlsv1 alert insufficient security
Unable to establish SSL connection.

Bei der Ausstellung eines korrekten Zeugnisses.

wget --save-headers --certificate=/sapmnt/accad/other/ilnwad15.tlv.sap.corp.crt --private-key=/sapmnt/accad/other/ilnwad15.tlv.sap.corp.key --no-check-certificate HTTPS://ilnwad15.tlv.sap.corp:1443
--2013-12-22 10:33:59--  https://ilnwad15.tlv.sap.corp:1443/
Resolving ilnwad15.tlv.sap.corp... 172.16.60.21
Connecting to ilnwad15.tlv.sap.corp|172.16.60.21|:1443... connected.
WARNING: cannot verify ilnwad15.tlv.sap.corp's certificate, issued by /C=IL/ST=Central District/L=Raanana/O=SAP AG/OU=AccAD/CN=AccAD CA/[email protected]:
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 4598 (4.5K) [text/html]
Saving to: `index.html'

100%[======================================>] 4,598       --.-K/s   in 0s      

2013-12-22 10:33:59 (38.5 MB/s) - `index.html' saved [4598/4598]

Danke: D

verwandte Informationen