nomis80 has asked for the wisdom of the Perl Monks concerning the following question:

In mod_perl programming, I want to know the scheme that a user used to communicate with the server, ie. 'http' or 'https'.

Said otherwise: how can I know if I'm on a SSL-enabled host or not? I can't use the port number for that, it may vary independently of SSL usage.

Thanks

Replies are listed 'Best First'.
Re: Knowing the scheme
by gav^ (Curate) on Aug 09, 2002 at 16:17 UTC
    If you are using CGI.pm:
    my $q = CGI->new; unless ($q->https) { # I'm not running under SSL }
    Or you could check $ENV{HTTPS}

    Hope this helps...

    gav^