Randy Kobes wrote:
> On Fri, 9 May 2003, Stas Bekman wrote:
>
> [ .. ]
>
>>Can anybody on win32 with mod_perl 1.0 and openssl please try
>>to fetch $ENV{SSL_SERVER_S_DN_Email} in a simple test script
>>once under mod_cgi and once more under mod_perl?
>
>
> I'm not sure if this reproduces Steve's original situation,
> but I just tried the following script:
> =========================================================
> #!C:/Perl/bin/perl
> ##
> ## printenv -- demo CGI program which just prints its environment
> ##
> use strict;
> $ENV{SSL_SERVER_S_DN_Email} = 'randy@theoryx5';
> print <<"END";
> Content-type: text/html
>
> <HTML><HEAD>
> <TITLE>Environment</TITLE>
> </HEAD><BODY>
> <H3>Environment variables</H3><UL>
> END
>
> foreach my $var (sort keys %ENV) {
> my $val = $ENV{$var};
> $val =~ s|\n|\\n|g;
> $val =~ s|"|\\"|g;
> print qq{<LI>${var} = "${val}"</LI>\n}; } print
> qq{<LI>SSL_SERVER_S_DN_Email =
> "$ENV{SSL_SERVER_S_DN_Email}"</LI>\n}; print
> '</UL></BODY></HTML>';
> =====================================================================
> I get the same behaviour running this as an ordinary cgi script
> (under Apache 1.3.27 or Apache 2.0.45), and also under
> Apache::Registry under mod_perl 1.27_01-dev and ModPerl::Registry
> under mod_perl 1.99_10 (all with openssl). Within the foreach
> loop, it comes out as
> SSL_SERVER_S_DN_EMAIL = "randy@theoryx5"
> and the last line gets printed as
> SSL_SERVER_S_DN_Email = "randy@theoryx5"
I think Steve's saying that $ENV{SSL_SERVER_S_DN_Email} doesn't work for him
under mod_cgi and he has to use $ENV{SSL_SERVER_S_DN_EMAIL} which fails under
mod_perl.
> So capitalization of the environment variable keys occurs when
> printing things out, but a lookup of environment variables by
> keys is case insensitive. So you can't have two distinct
> enviroment variables that differ only by case:
> C:\> set ZZZ=aaa
> C:\> set ZZZ
> ZZZ=aaa
> C:\> set zZz=bbb
> C:\> set zZz
> ZZZ=bbb
> C:\> set ZZZ
> ZZZ=bbb
>
> I also tried, rather than setting the environment variable
> within the script, setting it thru various combinations of
> the Apache directives SetEnv, PassEnv, PerlSetEnv, and
> PerlPassEnv, but in all cases it seemed to look up things
> up in a case insensitive manner.
>
> Steve, how, and from where, is the environment variable
> being set?
It's set by the openssl library, you have to enabled mod_ssl (or apache_ssl
for 1.x) to get it set.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
|