perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject RE: [mp2.0] Win32 ENV still not compatible with mod_cgi
Date Fri, 09 May 2003 13:57:11 GMT
On Fri, 9 May 2003 steve.sparling@ps.ge.com wrote:

[ .. ]
> mod_ssl is responsible for 'creating' this variable by
> examining the X509 SSL certificate credentials and creating a
> variable per item.
> 
> It does this via apr_table_setn(...) on r->process_env
> 
> ------------------------
> 
> So, in summary (win32) :-
> 
> 1) mod_ssl calls
> 
> 	apr_table_setn(r->process_env, "SSL_SERVER_S_DN_Email",
> "steve.sparling@ps.ge.com")
> 
> 2) mod_perl calls
> 
> 	modperl_env_table_populate(aTHX_ scfg->SetEnv);
> 	modperl_env_table_populate(aTHX_ scfg->PassEnv);
> 	modperl_env_table_populate(aTHX_ r->subprocess_env);
> 
> 3) ModPerl::Registry invokes perl script to extract variable :-
> 
> 	my $email = $ENV{SSL_SERVER_S_DN_Email};	# value is always
> <undef>
> 
> -------------------------
> 
> As mod_perl has NO control of what other modules place into r->process_env,
> mixed-case
> keys are being placed into %ENV (through the back-door)...
> 
> You can prove this if you iterate through %ENV :-
> 
> 	$ENV{testing} = 'Try this also...';
> 	while (($key, $value) = each %ENV)
> 	{
> 		print " $key = '$value'. Lookup gives '", $ENV{$key} ||
> '<undef>', "'\n";
> 	}
> 
> You actually get the following :-
> 
> 	SSL_SERVER_S_DN_Email = 'steve.sparling@ps.ge.com'. Lookup gives
> '<undef>'
> 	TESTING = 'Try this also...'. Lookup gives 'Try this also...'
> 

Thanks for that - I see that behaviour now, also. With
Apache 2.0.45:

cgi:      SSL_SERVER_S_DN_EMAIL = 'whatever'. 
          Lookup gives 'whatever'
mod_perl: SSL_SERVER_S_DN_Email = 'whatever'.
          Lookup gives '<undef>'

With Apache 1.3.27,

cgi:      SSL_SERVER_S_DN_EMAIL = 'whatever'. 
          Lookup gives 'whatever'
mod_perl: SSL_SERVER_S_DN_EMAIL = 'whatever'.
          Lookup gives 'whatever'
 
So the behaviour has changed under mod_perl 2, compared
to that of mod_perl 1.

-- 
best regards,
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message