in reply to Digest Authentication encoding issue

The first order of business would be find out in what encoding your web server expects the passwords to be in the password file. Come back after you find out the answer to that decidedly non-Perl question.
  • Comment on Re: Digest Authentication encoding issue

Replies are listed 'Best First'.
Re^2: Digest Authentication encoding issue
by Nik (Initiate) on Mar 21, 2008 at 13:38 UTC
    Very good idea i have googled for that to find out what encoding apache wants the passwords to be but i didnt find any relevant info

    So you are saying that inside my perl script iam currently creating the passwords as utf-8 but apache expect a different character set?

    But hold on....by seeign the following code how can i be sure the password file being created will stored contents in utf-8 format?

    open FILE, ">$ENV{'DOCUMENT_ROOT'}/some_path/some_other_path/some_pass +_file" or die $!; print FILE "webmaster:realm made by greek chars!:" .Digest::MD5::m +d5_hex("webmaster:realm made by greek chars!:password") ."\n"; close FILE;
    Is it because the init.pl scripts has this line print header( -charset=>'utf-8' ); means that every text and every file created by init.pl will be stored as utf-8 too?

    UPDATE: BASED on http://people.apache.org/~drtr/charsets.html i beleive apache expects them only in ISO 8859-1 if i understood the site correctly but please check it too.

    Based on that assumption i did try this:

    open FILE, ">:encoding(iso-8859-1)", "$ENV{'DOCUMENT_ROOT'}/some_path/ +some_other_path/some_pass_file" or die $!; print FILE "webmaster:realm made by greek chars!:" .Digest::MD5::m +d5_hex("webmaster:realm made by greek chars!:password") ."\n"; close FILE;
    The idea is to force the contents of the newly created file that contains the passwords that Apache checks to be stored as latin1-iso, but unfortunately that didnt work either.

    Now that i think of it my realm contains greek chars and i tell perl to store them in the passowrd file as latin1-iso, but thats impossible right? Either that is the problem now or the apache doesnt excpect the encoding toi be iso-8859-1

    I really did my best to solve this problem so now i deserve to hear from you.