Following your suggestion,

use Apache::URI ();
$r->parsed_uri->scheme; 

returns http or https.

However this value comes from apache's util_uri
where https is mapped to DEFAULT_HTTPS_PORT.

src/include/httpd.h:#define DEFAULT_HTTPS_PORT        443 

However with OpenSSL and mod_ssl, this still works because somewhere at
ssl_engine_ext.c
DEFAULT_HTTPS_PORT is overwritten and the schema returns https on other
port when ssl is engaged.
So, the question is, can i trust this?

Thanks, 
João Pedro

Kenneth Lee wrote:
> 
> how about the scheme of the request URL? hmm.. but that needs
> parsing the URL...
> 
> Joao Pedro Gonçalves wrote:
> >
> > Hi, is there any method that will work through all the different
> > apache ssl implementations?
> > Currently what i do (with openssl) is:
> >
> > my $s = $r->lookup_uri($r->uri);
> > my $ssl = $s->subprocess_env('HTTPS');
> >
> > $ssl becomes 'on' , but i don't know if this is compatible with other
> > ssl implementations.
> > Maybe this HTTPS env could be mapped to mod_perl %ENV, or using
> > something similar for each ssl
> > implementation so that a developer could trust on one place to know
> > whether the request is using ssl or not.
> >
> > Thank your for you attention,
> > Joao Pedro

Reply via email to