You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matthias Kellermann <ma...@adminlife.net> on 2008/02/25 16:36:16 UTC

[users@httpd] mod_authn_dbd, MySQL and MD5 passwords

Hi list,

I've got some troubles setting up authentication via DBD with a MySQL 
database and passwords crypted with MD5.

My setup (Gentoo Linux):
Apache 2.2.8
apr 1.2.11
apr-util 1.2.10
MySQL 5.0.54

My configuration:
DBDriver mysql
DBDParams "host=192.168.0.x dbname=auth user=auth pass=xxxx"
DBDPersist On
DBDMin  1
DBDKeep 2
DBDMax  10
DBDExptime 60

<Location />
   AuthName "secure"
   AuthType basic
   AuthBasicProvider dbd
   Require valid-user
   AuthDBDUserPWQuery "select password from user where login = %s"
</Location>

When I want to connect to the secured site it won't work. The log shows:
[error] [client xx.xx.xx.x] user myuser: authentication failure for "/": 
Password Mismatch

If I choose a non-existent user I'll get:
[error] [client xx.xx.xx.xx] user notmyuser not found: /

So the MySQL connection works, but something with the MD5 password is 
not ok. Any ideas what could be the problem?

-Matthias


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_authn_dbd, MySQL and MD5 passwords

Posted by Matthias Kellermann <ma...@adminlife.net>.
Tom Donovan wrote:
> The encrypted password formats which Apache recognizes
> are documented at 
> http://httpd.apache.org/docs/2.2/misc/password_encryptions.html
> 
> Passwords encrypted with the MySQL MD5() function will not work with 
> Apache authentication.
> 
> -tom-
Thanks Tom.

Is there any chance that MySQL MD5 passwords will work in oncoming 
versions of Apache?

I guess I have to stick with some patched version of mod_auth_mysql [1] 
for now, right?

- Matthias

[1] http://modauthmysql.sourceforge.net/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_authn_dbd, MySQL and MD5 passwords

Posted by Tom Donovan <do...@bellatlantic.net>.
Matthias Kellermann wrote:
> Hi list,
> 
> I've got some troubles setting up authentication via DBD with a MySQL 
> database and passwords crypted with MD5.
> 
> My setup (Gentoo Linux):
> Apache 2.2.8
> apr 1.2.11
> apr-util 1.2.10
> MySQL 5.0.54
...
> 
> So the MySQL connection works, but something with the MD5 password is 
> not ok. Any ideas what could be the problem?
> 

The encrypted password formats which Apache recognizes
are documented at http://httpd.apache.org/docs/2.2/misc/password_encryptions.html

Passwords encrypted with the MySQL MD5() function will not work with Apache authentication.

-tom-

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_authn_dbd, MySQL and MD5 passwords

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, Feb 25, 2008 at 7:12 PM, Res <re...@ausics.net> wrote:
> On Mon, 25 Feb 2008, Matthias Kellermann wrote:
>
>  > I've got some troubles setting up authentication via DBD with a MySQL
>  > database and passwords crypted with MD5.
>
>  >
>
> > So the MySQL connection works, but something with the MD5 password is not ok.
>  > Any ideas what could be the problem?
>
>  Yep, Apache does not use MD5, it uses ENCRYPT

Not quite. See:
http://httpd.apache.org/docs/2.2/misc/password_encryptions.html

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_authn_dbd, MySQL and MD5 passwords

Posted by Res <re...@ausics.net>.
On Mon, 25 Feb 2008, Matthias Kellermann wrote:

> I've got some troubles setting up authentication via DBD with a MySQL 
> database and passwords crypted with MD5.

>
> So the MySQL connection works, but something with the MD5 password is not ok. 
> Any ideas what could be the problem?

Yep, Apache does not use MD5, it uses ENCRYPT

-- 
Cheers
Res

mysql> update auth set Framed-IP-Address='127.0.0.127' where user= 'troll';

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org