Apache-SSLLookup-2.00_04/0000755000076400007640000000000010254277712015165 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/Changes0000755000076400007640000000113410254277523016462 0ustar geoffgeoff00000000000000Revision history for Perl extension Apache::SSLLookup 2.00_01 11.02.2004 - original version 2.00_02 11.11.2004 - test updates - no code changes 2.00_03 04.13.2005 - updates for mod_perl 2.0-RC5 (1.999_22) - add ext_lookup() method but keep undocumented until I figure out how it works. at the moment it seems to work except it never returns anything but undef, which may be a problem with the certs I'm generating. 2.00_04 06.16.2005 - fix Apache2::RequestRec subclassing. tests++ - add Devel::Cover hooks, even though they don't report any of the XS routines (yet) Apache-SSLLookup-2.00_04/SSLLookup.xs0000755000076400007640000000537410254277201017401 0ustar geoffgeoff00000000000000#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "mod_perl.h" #include "modperl_xs_typedefs.h" typedef request_rec * Apache__SSLLookup; APR_DECLARE_OPTIONAL_FN(char *, ssl_var_lookup, (apr_pool_t *, server_rec *, conn_rec *, request_rec *, char *)); APR_DECLARE_OPTIONAL_FN(int, ssl_is_https, (conn_rec *)); APR_DECLARE_OPTIONAL_FN(const char *, ssl_ext_lookup, (apr_pool_t *p, conn_rec *c, int peer, const char *oidnum)); static APR_OPTIONAL_FN_TYPE(ssl_var_lookup) *perl_ssl_lookup = NULL; static APR_OPTIONAL_FN_TYPE(ssl_is_https) *perl_is_https = NULL; static APR_OPTIONAL_FN_TYPE(ssl_ext_lookup) *perl_ext_lookup = NULL; static int get_ssl_functions(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { perl_ssl_lookup = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup); perl_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https); perl_ext_lookup = APR_RETRIEVE_OPTIONAL_FN(ssl_ext_lookup); return OK; } static const char * const aszPre[] = { "mod_ssl.c", NULL }; MODULE = Apache::SSLLookup PACKAGE = Apache::SSLLookup PROTOTYPES: DISABLE BOOT: ap_hook_post_config(get_ssl_functions, aszPre, NULL, APR_HOOK_MIDDLE); SV * new(self, r) SV * self Apache2::RequestRec r INIT: MP_dTHX; /* interpreter selection */ SV *obj = newSV(0); HV *hv = newHV(); self = self; /* satisfy warnings */ CODE: /* bless { _r => $r }, $class */ hv_store(hv, "_r", 2, modperl_ptr2obj(aTHX_ "Apache2::RequestRec", r), FALSE); obj = newRV_noinc((SV *)hv); sv_bless(obj, gv_stashpv("Apache::SSLLookup", TRUE)); RETVAL = obj; OUTPUT: RETVAL int is_https(r) Apache::SSLLookup r CODE: RETVAL = 0; if (perl_is_https) { MP_TRACE_a(MP_FUNC, "seeing if request for %s is under SSL", r->uri); RETVAL = perl_is_https(r->connection); } OUTPUT: RETVAL char * ssl_lookup(r, var) Apache::SSLLookup r char *var CODE: RETVAL = Nullch; if (perl_ssl_lookup) { MP_TRACE_a(MP_FUNC, "looking for SSL variable '%s'", var); RETVAL = perl_ssl_lookup(r->pool, r->server, r->connection, r, var); } OUTPUT: RETVAL const char * ext_lookup(r, oid, peer = 0) Apache::SSLLookup r const char *oid int peer CODE: RETVAL = Nullch; if (perl_ext_lookup) { MP_TRACE_a(MP_FUNC, "retrieving SSL certificate '%s' from the %s", oid, peer ? "client" : "server"); RETVAL = perl_ext_lookup(r->pool, r->connection, peer, oid); } OUTPUT: RETVAL BOOT: av_push(perl_get_av("Apache::SSLLookup::ISA",TRUE), newSVpv("Apache2::RequestRec",19)); Apache-SSLLookup-2.00_04/typemap0000755000076400007640000001665410222601462016572 0ustar geoffgeoff00000000000000# mod_perl 1.99_17's typemap, plus our Apache::SSLLookup Apache::SSLLookup T_APACHEOBJ APR::ArrayHeader T_PTROBJ APR::Brigade T_PTROBJ APR::Bucket T_PTROBJ APR::BucketAlloc T_PTROBJ APR::BucketType T_PTROBJ APR::ExplodedTime T_PTROBJ APR::Finfo T_PTROBJ APR::Getopt T_PTROBJ APR::GetoptOption T_PTROBJ APR::Hash T_PTROBJ APR::HashIndex T_PTROBJ APR::InAddr T_PTROBJ APR::IpSubnet T_PTROBJ APR::MD5 T_PTROBJ APR::Mmap T_PTROBJ APR::Pool T_POOLOBJ APR::Process T_PTROBJ APR::SHA1 T_PTROBJ APR::SockAddr T_PTROBJ APR::SockInfo T_PTROBJ APR::Socket T_PTROBJ APR::Table T_HASHOBJ APR::TableEntry T_PTROBJ APR::ThreadMutex T_PTROBJ APR::URI T_PTROBJ APR::UUID T_PTROBJ Apache2::CmdParms T_PTROBJ Apache2::Command T_PTROBJ Apache2::ConfVector T_PTROBJ Apache2::ConfigFile T_PTROBJ Apache2::Connection T_PTROBJ Apache2::Directive T_PTROBJ Apache2::Filter T_PTROBJ Apache2::FilterRec T_PTROBJ Apache2::FilterType T_PTROBJ Apache2::MethodList T_PTROBJ Apache2::Module T_PTROBJ Apache2::OutputFilter T_PTROBJ Apache2::PipedLog T_PTROBJ Apache2::Process T_PTROBJ Apache2::RequestRec T_APACHEOBJ Apache2::ServerAddr T_PTROBJ Apache2::ServerRec T_PTROBJ Apache2::SubRequest T_PTROBJ I32 T_IV I32 * T_IV SV * T_SV U32 T_UV U32 * T_UV ap_conn_keepalive_e T_IV ap_input_mode_t T_IV ap_input_mode_t * T_IV ap_mgmt_type_e T_IV ap_scoreboard_e T_IV apr_byte_t T_CHAR apr_byte_t * T_CHAR apr_dev_t T_NV apr_dev_t * T_NV apr_fileperms_t T_IV apr_fileperms_t * T_IV apr_filetype_e T_IV apr_gid_t T_IV apr_gid_t * T_IV apr_ino_t T_IV apr_ino_t * T_IV apr_int16_t T_IV apr_int16_t * T_IV apr_int32_t T_IV apr_int32_t * T_IV apr_int64_t T_NV apr_int64_t * T_NV apr_interval_time_t T_NV apr_interval_time_t * T_NV apr_lockmech_e T_IV apr_locktype_e T_IV apr_off_t T_IV apr_off_t * T_IV apr_port_t T_IV apr_port_t * T_IV apr_read_type_e T_IV apr_size_t T_UV apr_size_t * T_UV apr_socklen_t T_IV apr_socklen_t * T_IV apr_ssize_t T_IV apr_ssize_t * T_IV apr_status_t T_IV apr_status_t * T_IV apr_time_t T_APR_TIME apr_time_t * T_NV apr_uid_t T_IV apr_uid_t * T_IV apr_uint16_t T_IV apr_uint16_t * T_IV apr_uint32_t T_IV apr_uint32_t * T_IV apr_uint64_t T_NV apr_uint64_t * T_NV char T_CHAR char * T_PV char const * T_PV const ap_input_mode_t * T_IV const apr_byte_t * T_CHAR const apr_dev_t * T_NV const apr_fileperms_t * T_IV const apr_gid_t * T_IV const apr_ino_t * T_IV const apr_int16_t * T_IV const apr_int32_t * T_IV const apr_int64_t * T_NV const apr_interval_time_t * T_NV const apr_off_t * T_IV const apr_port_t * T_IV const apr_size_t * T_UV const apr_socklen_t * T_IV const apr_ssize_t * T_IV const apr_status_t * T_IV const apr_time_t * T_NV const apr_uid_t * T_IV const apr_uint16_t * T_IV const apr_uint32_t * T_IV const apr_uint64_t * T_NV const char T_CHAR const char * T_PV const gid_t * T_IV const pid_t * T_IV const size_t * T_IV const time_t * T_NV const uid_t * T_IV const unsigned char T_U_CHAR const unsigned char * T_PV const void * T_PTR double T_NV enum cmd_how T_IV gid_t T_IV gid_t * T_IV int T_IV int * T_PTR long T_IV long int T_IV pid_t T_IV pid_t * T_IV signed int T_IV size_t T_IV time_t T_NV time_t * T_NV uid_t T_IV uid_t * T_IV unsigned T_UV unsigned char T_U_CHAR unsigned char * T_PV unsigned int T_UV unsigned long T_UV void T_VOID void * T_PTR TYPEMAP void * T_VPTR char_len * T_CHAR_LEN const char_len * T_CONST_CHAR_LEN ###################################################################### OUTPUT T_POOLOBJ sv_setref_pv($arg, \"${ntype}\", (void*)$var); T_APACHEOBJ sv_setref_pv($arg, \"${ntype}\", (void*)$var); T_HASHOBJ $arg = modperl_hash_tie(aTHX_ \"${ntype}\", $arg, $var); T_VPTR sv_setiv($arg, PTR2IV($var)); T_APR_TIME sv_setnv($arg, (NV)(apr_time_sec($var))); T_UVOBJ modperl_perl_sv_setref_uv(aTHX_ $arg, \"${ntype}\", (UV)$var); ###################################################################### INPUT T_PTROBJ if (SvROK($arg) && sv_derived_from($arg, \"${ntype}\")) { IV tmp = SvIV((SV*)SvRV($arg)); $var = INT2PTR($type,tmp); } else { Perl_croak(aTHX_ SvROK($arg) ? \"$var is not of type ${ntype}\" : \"$var is not a blessed reference\"); } T_POOLOBJ if (SvROK($arg) && sv_derived_from($arg, \"${ntype}\")) { IV tmp = SvIV((SV*)SvRV($arg)); if (tmp == 0) { Perl_croak(aTHX_ \"invalid pool object (already destroyed?)\"); } $var = INT2PTR($type,tmp); } else { Perl_croak(aTHX_ SvROK($arg) ? \"$var is not of type ${ntype}\" : \"$var is not a blessed reference\"); } T_UVOBJ if (SvROK($arg) && sv_derived_from($arg, \"${ntype}\")) { UV tmp = SvUV((SV*)SvRV($arg)); $var = ($type)tmp; } else { Perl_croak(aTHX_ SvROK($arg) ? \"$var is not of type ${ntype}\" : \"$var is not a blessed reference\"); } T_APACHEOBJ $var = modperl_xs_sv2request_rec(aTHX_ $arg, \"$ntype\", cv) T_HASHOBJ $var = modperl_hash_tied_object(aTHX_ \"${ntype}\", $arg) T_APACHEREF $var = modperl_xs_sv2request_rec(aTHX_ $arg, \"$ntype\", cv) T_VPTR $var = INT2PTR($type,SvIV(SvROK($arg) ? SvRV($arg) : $arg)) T_APR_TIME $var = (apr_time_t)(apr_time_from_sec(SvNV($arg))) T_CHAR_LEN $var = (char *)SvPV($arg, ${var}_len) T_CONST_CHAR_LEN $var = (const char *)SvPV($arg, ${var}_len) Apache-SSLLookup-2.00_04/META.yml0000755000076400007640000000053110254277712016440 0ustar geoffgeoff00000000000000# http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Apache-SSLLookup version: 2.00_04 version_from: SSLLookup.pm installdirs: site requires: mod_perl2: 0 distribution_type: module generated_by: ExtUtils::MakeMaker version 6.17 Apache-SSLLookup-2.00_04/SSLLookup.pm0000755000076400007640000000544510254277422017367 0ustar geoffgeoff00000000000000package Apache::SSLLookup; use 5.008001; use strict; use DynaLoader (); our @ISA = qw(DynaLoader); our $VERSION = '2.00_04'; __PACKAGE__->bootstrap($VERSION); 1; __END__ =head1 NAME Apache::SSLLookup - hooks for various mod_ssl functions =head1 SYNOPSIS in httpd.conf: # pre-loading via PerlModule or startup.pl is REQUIRED!!! PerlModule Apache::SSLLookup in any handler: sub handler { my $r = Apache::SSLLookup->new(shift); my $request_is_over_ssl = $r->is_https; my $value = $r->lookup_var('SSL_CLIENT_VERIFY'); ... } =head1 DESCRIPTION Apache::SSLLookup is a glue layer between Perl handlers and the mod_ssl public API. under normal circumstances, you would use C<$rEsubprocess_env()> to glean information about mod_ssl. for example, my $request_is_over_ssl = $r->subprocess_env('HTTPS'); however, this is only possible after mod_ssl runs its fixups - that is, Perl handlers can only accurately check the C table for mod_ssl information in the PerlResponsePhase or later. 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. =head1 METHODS there are only three methods you need to be concerned with. =over 4 =item new() to use this class you create an C object. C is a subclass of C so you can simply call C and get on with your business. my $r = Apache::SSLLookup->new($r); =item is_https() returns true if mod_ssl considers the request to be under SSL. my $request_is_over_ssl = $r->is_https; you can call this function any time during the request, specifically before mod_ssl populates C in the fixup phase. you must be using Apache 2.0.51 or greater for this method to accurately reflect the SSL status of the request. =item lookup_var() returns the value of various mod_ssl environment variables. my $value = $r->lookup_var('SSL_CLIENT_VERIFY'); you can call this function any time during the request, specifically before mod_ssl populates C in the fixup phase. =back =head1 NOTES this module is for Apache 2.0 exclusively. it will not work with Apache 1.3. 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... =head1 AUTHOR Geoffrey Young Egeoff@modperlcookbook.orgE =head1 COPYRIGHT Copyright (c) 2004, Geoffrey Young All rights reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. =cut Apache-SSLLookup-2.00_04/MANIFEST0000644000076400007640000000056210254277617016325 0ustar geoffgeoff00000000000000Changes Makefile.PL MANIFEST This list of files META.yml README SSLLookup.pm SSLLookup.xs t/conf/modperl_extra.pl t/conf/ssl/ssl.last.conf.in t/live/01api.t t/live/all.t t/response/TestLive/01api.pm t/response/TestSSL/01compile.pm t/response/TestSSL/02new.pm t/response/TestSSL/03https.pm t/response/TestSSL/04lookup.pm t/response/TestSSL/05ext.pm t/ssl/all.t typemap Apache-SSLLookup-2.00_04/README0000755000076400007640000000501210142057401016031 0ustar geoffgeoff00000000000000NAME Apache::SSLLookup - hooks for various mod_ssl functions SYNOPSIS in httpd.conf: # pre-loading via PerlModule or startup.pl is REQUIRED!!! PerlModule Apache::SSLLookup in any handler: sub handler { my $r = Apache::SSLLookup->new(shift); my $request_is_over_ssl = $r->is_https; my $value = $r->lookup_var('SSL_CLIENT_VERIFY'); ... } DESCRIPTION Apache::SSLLookup is a glue layer between Perl handlers and the mod_ssl public API. under normal circumstances, you would use C<$rEsubprocess_env()> to glean information about mod_ssl. for example, my $request_is_over_ssl = $r->subprocess_env('HTTPS'); however, this is only possible after mod_ssl runs its fixups - that is, Perl handlers can only accurately check the C table for mod_ssl information in the PerlResponsePhase or later. 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. METHODS there are only three methods you need to be concerned with. new() to use this class you create an C object. C is a subclass of C so you can simply call C and get on with your business. my $r = Apache::SSLLookup->new($r); is_https() returns true if mod_ssl considers the request to be under SSL. my $ssl = $r->is_https; you can call this function any time during the request, specifically before mod_ssl populates C in the fixup phase. you must be using Apache 2.0.51 or greater for this method to accurately reflect the SSL status of the request. lookup_var() returns the value of various mod_ssl environment variables. my $value = $r->lookup_var('SSL_CLIENT_VERIFY'); you can call this function any time during the request, specifically before mod_ssl populates C in the fixup phase. NOTES this module is for Apache 2.0 exclusively. it will not work with Apache 1.3. 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... AUTHOR Geoffrey Young Egeoff@modperlcookbook.orgE COPYRIGHT Copyright (c) 2004, Geoffrey Young All rights reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. Apache-SSLLookup-2.00_04/t/0000755000076400007640000000000010254277712015430 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/t/live/0000755000076400007640000000000010254277712016367 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/t/live/01api.t0000755000076400007640000000044110144575616017472 0ustar geoffgeoff00000000000000use strict; use warnings FATAL => qw(all); use Apache::Test; use Apache::TestRequest; my $hostport = Apache::Test::config ->{vhosts} ->{TestLive} ->{hostport}; my $url = "https://$hostport/TestLive__01api/"; print GET_BODY_ASSERT $url; Apache-SSLLookup-2.00_04/t/live/all.t0000755000076400007640000000040010142031132017275 0ustar geoffgeoff00000000000000use strict; use warnings FATAL => 'all'; use Apache::Test; my $vars = Apache::Test::vars(); #skip all tests in this directory unless ssl is enabled #and LWP has https support plan tests => 1, [$vars->{ssl_module_name}, qw(LWP::Protocol::https)]; ok 1; Apache-SSLLookup-2.00_04/t/ssl/0000755000076400007640000000000010254277712016231 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/t/ssl/all.t0000755000076400007640000000021510222602654017157 0ustar geoffgeoff00000000000000use strict; use warnings FATAL => 'all'; use Apache::Test; plan tests => 1, need_min_module_version('Test::Builder' => '0.18_01'); ok 1; Apache-SSLLookup-2.00_04/t/conf/0000755000076400007640000000000010254277712016355 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/t/conf/ssl/0000755000076400007640000000000010254277712017156 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/t/conf/ssl/ssl.last.conf.in0000755000076400007640000000142010254272053022166 0ustar geoffgeoff00000000000000# this is here instead of t/response/TestLive/01api.pm # because we need _something_ under t/conf/ssl to hold # it open so our CA foo is created, since 'make dist' # won't roll up an empty directory # this is _critical_ # without preloading the module the optional functions # are not defined PerlModule Apache::SSLLookup SSLEngine on SSLCertificateFile @SSLCA@/asf/certs/server.crt SSLCertificateKeyFile @SSLCA@/asf/keys/server.pem SetHandler modperl PerlResponseHandler TestLive::01api # Devel::Cover integration # pass these to modperl_extra.pl PerlPassEnv HARNESS_PERL_SWITCHES PerlPassEnv APACHE_TEST_NO_STICKY_PREFERENCES Apache-SSLLookup-2.00_04/t/conf/modperl_extra.pl0000755000076400007640000000110110254272145021546 0ustar geoffgeoff00000000000000# this is equivalent to your startup.pl. # it does not need to contain anything unless # startup.pl behavior is a required part of your module if ($ENV{HARNESS_PERL_SWITCHES}) { eval { # 0.48 is the first version of Devel::Cover that can # really generate mod_perl coverage statistics require Devel::Cover; Devel::Cover->VERSION(0.48); # this ignores coverage data for some generated files # you may need to adjust this slightly for your config Devel::Cover->import('+inc' => 't/response/',); 1; } or die "Devel::Cover error: $@"; } 1; Apache-SSLLookup-2.00_04/t/response/0000755000076400007640000000000010254277712017266 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/t/response/TestSSL/0000755000076400007640000000000010254277712020567 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/t/response/TestSSL/03https.pm0000755000076400007640000000071310224772362022434 0ustar geoffgeoff00000000000000package TestSSL::03https; use strict; use warnings FATAL => qw(all); use Apache::Test qw(-withtestmore); use Apache2::Const -compile => qw(OK); sub handler { my $r = shift; plan $r, tests => 3; { use_ok('Apache::SSLLookup'); } { can_ok('Apache::SSLLookup', 'is_https'); } { $r = Apache::SSLLookup->new($r); ok(defined $r->is_https, 'is_https() returned a defined value'); } return Apache2::Const::OK; } 1; Apache-SSLLookup-2.00_04/t/response/TestSSL/04lookup.pm0000755000076400007640000000072510224772365022612 0ustar geoffgeoff00000000000000package TestSSL::04lookup; use strict; use warnings FATAL => qw(all); use Apache::Test qw(-withtestmore); use Apache2::Const -compile => qw(OK); sub handler { my $r = shift; plan $r, tests => 3; { use_ok('Apache::SSLLookup'); } { can_ok('Apache::SSLLookup', 'ssl_lookup'); } { $r = Apache::SSLLookup->new($r); ok(!$r->ssl_lookup('foo'), 'non-existent ssl variable returned false'); } return Apache2::Const::OK; } 1; Apache-SSLLookup-2.00_04/t/response/TestSSL/05ext.pm0000755000076400007640000000111210225002053022046 0ustar geoffgeoff00000000000000package TestSSL::05ext; use strict; use warnings FATAL => qw(all); use Apache::Test qw(-withtestmore); use Apache2::Const -compile => qw(OK); sub handler { my $r = shift; plan $r, tests => 4; { use_ok('Apache::SSLLookup'); } { can_ok('Apache::SSLLookup', 'ext_lookup'); } { $r = Apache::SSLLookup->new($r); ok(!$r->ext_lookup('060406142524Z'), 'nothing to find on the server when not using ssl'); ok(!$r->ext_lookup('060406142524Z'), 'nothing to find on the client when not using ssl'); } return Apache2::Const::OK; } 1; Apache-SSLLookup-2.00_04/t/response/TestSSL/02new.pm0000755000076400007640000000172310254277341022064 0ustar geoffgeoff00000000000000package TestSSL::02new; use strict; use warnings FATAL => qw(all); use Apache::Test qw(-withtestmore); use Apache2::Const -compile => qw(OK); sub handler { my $r = shift; plan $r, tests => 7; { use_ok('Apache::SSLLookup'); } { can_ok('Apache::SSLLookup', 'new'); } { eval { $r = Apache::SSLLookup->new() }; like ($@, qr/Usage:/, 'new() requires arguments'); } { eval { $r = Apache::SSLLookup->new({}) }; like ($@, qr/method `new' invoked by a `unknown' object with no `r' key/, 'new() requires an object'); } { eval { $r = Apache::SSLLookup->new(bless {}, 'foo') }; like ($@, qr/method `new' invoked by a `foo' object with no `r' key/, 'new() requires an Apache2::RequestRec object'); } { $r = Apache::SSLLookup->new($r); isa_ok($r, 'Apache::SSLLookup'); isa_ok($r, 'Apache2::RequestRec'); } return Apache2::Const::OK; } 1; Apache-SSLLookup-2.00_04/t/response/TestSSL/01compile.pm0000755000076400007640000000042210224772352022714 0ustar geoffgeoff00000000000000package TestSSL::01compile; use strict; use warnings FATAL => qw(all); use Apache::Test qw(-withtestmore); use Apache2::Const -compile => qw(OK); sub handler { my $r = shift; plan $r, tests => 1; use_ok('Apache::SSLLookup'); return Apache2::Const::OK; } 1; Apache-SSLLookup-2.00_04/t/response/TestLive/0000755000076400007640000000000010254277712021025 5ustar geoffgeoff00000000000000Apache-SSLLookup-2.00_04/t/response/TestLive/01api.pm0000755000076400007640000000217510254277303022301 0ustar geoffgeoff00000000000000package TestLive::01api; use strict; use warnings FATAL => qw(all); use Apache::Test qw(-withtestmore); use Apache2::Const -compile => qw(OK); use Apache::SSLLookup; sub handler { my $r = shift; plan $r, tests => 6; $r = Apache::SSLLookup->new($r); SKIP : { skip 'apache 2.0.51 required', 1 unless have_min_apache_version('2.0.51'); ok($r->is_https, 'is_https() returned true'); } ok($r->ssl_lookup('https'), 'HTTPS variable returned true'); is($r->ssl_lookup('ssl_client_verify'), 'NONE', 'SSL_CLIENT_VERIFY returned ssl.conf value'); SKIP : { skip 'apache 2.1.3 required', 2 unless have_min_apache_version('2.1.3'); TODO : { local $TODO = "ext_lookup() is experimental"; is($r->ext_lookup('2.5.4.3'), '???', 'server'); is($r->ext_lookup('2.5.4.3', 1), '???', 'client'); } } # can we still call $r methods? my $ct = $r->content_type; like ($ct, qr!text/plain!, 'successfully called $r->content_type()'); return Apache2::Const::OK; } 1; __DATA__ Apache-SSLLookup-2.00_04/Makefile.PL0000755000076400007640000000111710224766705017144 0ustar geoffgeoff00000000000000#!perl use 5.008001; use ModPerl::MM (); use Apache::TestMM qw(test clean); use Apache::TestRunPerl (); Apache::TestMM::filter_args(); Apache::TestRunPerl->generate_script(bugreport => < 'Apache::SSLLookup', VERSION_FROM => 'SSLLookup.pm', PREREQ_PM => { mod_perl2 => 0 }, TYPEMAPS => [qw(typemap)], );