.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SSLLookup 3pm" .TH SSLLookup 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Apache::SSLLookup \- hooks for various mod_ssl functions .SH SYNOPSIS .IX Header "SYNOPSIS" in httpd.conf: .PP .Vb 2 \& # pre\-loading via PerlModule or startup.pl is REQUIRED!!! \& PerlModule Apache::SSLLookup .Ve .PP in any handler: .PP .Vb 2 \& sub handler { \& my $r = Apache::SSLLookup\->new(shift); \& \& my $request_is_over_ssl = $r\->is_https; \& \& my $value = $r\->lookup_var(\*(AqSSL_CLIENT_VERIFY\*(Aq); \& \& ... \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Apache::SSLLookup is a glue layer between Perl handlers and the mod_ssl public API. under normal circumstances, you would use \f(CW\*(C`$r>subprocess_env()\*(C'\fR to glean information about mod_ssl. for example, .PP .Vb 1 \& my $request_is_over_ssl = $r\->subprocess_env(\*(AqHTTPS\*(Aq); .Ve .PP however, this is only possible after mod_ssl runs its fixups \- that is, Perl handlers can only accurately check the \&\f(CW\*(C`subprocess_env\*(C'\fR table for mod_ssl information in the PerlResponsePhase or later. .PP this module allows you to query mod_ssl directly via its public C API at any point in the request cycle. but without using C, of course. .SH METHODS .IX Header "METHODS" there are only three methods you need to be concerned with. .IP \fBnew()\fR 4 .IX Item "new()" to use this class you create an \f(CW\*(C`Apache::SSLLookup\*(C'\fR object. \&\f(CW\*(C`Apache::SSLLookup\*(C'\fR is a subclass of \f(CW\*(C`Apache::RequestRec\*(C'\fR so you can simply call \f(CWnew()\fR and get on with your business. .Sp .Vb 1 \& my $r = Apache::SSLLookup\->new($r); .Ve .IP \fBis_https()\fR 4 .IX Item "is_https()" returns true if mod_ssl considers the request to be under SSL. .Sp .Vb 1 \& my $request_is_over_ssl = $r\->is_https; .Ve .Sp you can call this function any time during the request, specifically before mod_ssl populates \f(CWsubprocess_env(\*(AqHTTPS\*(Aq)\fR in the fixup phase. .Sp you must be using Apache 2.0.51 or greater for this method to accurately reflect the SSL status of the request. .IP \fBlookup_var()\fR 4 .IX Item "lookup_var()" returns the value of various mod_ssl environment variables. .Sp .Vb 1 \& my $value = $r\->lookup_var(\*(AqSSL_CLIENT_VERIFY\*(Aq); .Ve .Sp you can call this function any time during the request, specifically before mod_ssl populates \f(CWsubprocess_env()\fR in the fixup phase. .SH NOTES .IX Header "NOTES" this module is for Apache 2.0 exclusively. it will not work with Apache 1.3. .PP you MUST MUST MUST preload this module with PerlModule or from a startup.pl. what if you don't? the short answer is that this module will do nothing for you. the long answer is that unless you preload the module it will not be able to glean the optional function definitions from mod_ssl. I'm still trying to figure out why not... .SH AUTHOR .IX Header "AUTHOR" Geoffrey Young .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 2004, Geoffrey Young .PP All rights reserved. .PP This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.