Programming :  Student Freelance Forum For Work Experience Builders' (CertificationPoint) The fastest message board... ever.
 
PERL-
Posted by: adcertpoint (Moderator)
Date: April 29, 2020 04:39PM

Just like $ENV{MODPERL} is checked to see whether the code is run under mod_perl, $ENV{HTTPS} is set by ssl modules and therefore can be used to check whether a request is running over SSL connection. For example:
print "SSL" if $ENV{HTTPS};

If PerlSetupEnv Off setting is in effect, $ENV{HTTPS} won't be available, and then:
print "SSL" if $r->subprocess_env('https');

should be used instead.

Note that it's also possible to check the scheme:
print "SSL" if Apache::URI->parse($r)->scheme =~ m/^https/;

but it's not one hundred percent certain unless you control the server and you know that you run a secure server on the port 443.

Options: ReplyQuote


Sorry, only registered users may post in this forum.
This forum powered by Phorum.