Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

apache mod_proxy + Authentisierung per FakeBasicAuth

55 views
Skip to first unread message

Friedemann Stoyan

unread,
Apr 21, 2012, 10:29:47 AM4/21/12
to
Hallo NG!

Folgende Konstellation:

Server Version: Apache/2.2.16 (Debian)

Innerhalb eines SSL-Vhosts:

<IfModule proxy_module>
<IfModule proxy_connect_module>
ProxyRequests On
AllowConnect 22 443
<Proxy *>
Order allow,deny
allow from all
SSLRequireSSL
SSLVerifyClient require
SSLOptions +FakeBasicAuth +StrictRequire
AuthType Basic
AuthName "Proxy Access"
AuthBasicProvider file
AuthUserFile /etc/apache2/passwd.d/proxy
Require valid-user
</Proxy>
</IfModule>
</IfModule>

Das Problem ist, dass die Authorisierung per AuthUserFile nicht funktioniert.
Im Logfile sehe ich noch ankommen:

Faking HTTP Basic Auth header: "Authorization: Basic L0M9REUvU1Q9TlJXL0NOPXBjNjMwMC5leHRlcm5hbC5leGFtcGxlLmNvbTpwYXNzd29yZA=="

Das ist sehr gut, denn

$ echo "L0M9REUvU1Q9TlJXL0NOPXBjNjMwMC5leHRlcm5hbC5leGFtcGxlLmNvbTpwYXNzd29yZA==" | base64 -d; echo
/C=DE/ST=NRW/CN=pc6300.external.example.com:password

und genau dies ist im AuthUserFile eingetragen:

/C=DE/ST=NRW/CN=pc6300.external.example.com:xxj31ZMTZzkVA

Trotzdem scheitert die Authorisierung, der Client bekommt:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>407 Proxy Authentication Required</title>
</head><body>
<h1>Proxy Authentication Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<p>Additionally, a 400 Bad Request
error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache Server at example.com Port 443</address>
</body></html>

Ich habe mir mal die Mühe gemacht, den apache mit strace zu starten.
Was ich dabei nicht sehen konnte, war ein open des AuthUserFile. Sehr
seltsam.

Kommentiere ich "Require valid-user" aus, funktiniert alles, jeder Client,
der ein valides Zertifikat präsentiert kommt zum Zuge.

Die Authentisierung/Authoriserung mit Clientzertifikaten, wie auch per
User-Credential funktioniert in diesem Server, da:

<Directory /home/*/public_html/data>
Dav on
SSLRequireSSL
SSLOptions +FakeBasicAuth +StrictRequire
AllowOverride AuthConfig
ForceType text/plain
AuthName "User Data Storage"
AuthType Basic
AuthBasicProvider file
Require valid-user
</Directory>

einwandfrei funktioniert.

Ich bin momentan etwas rat- und ideenlos. Meinungen?

mfg Friedemann
0 new messages