Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Digest Authentication encoding issue

by Nik
on Mar 21, 2008 at 13:38 UTC ( #675412=note: print w/ replies, xml ) Need Help??


in reply to Re: Digest Authentication encoding issue
in thread Digest Authentication encoding issue

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.


Comment on Re^2: Digest Authentication encoding issue
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://675412]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-12-21 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (108 votes), past polls