
Apache2::ModSSL - a Perl Interface to mod_ssl functions

use Apache2::ModSSL;
my $c=$r->connection;
if( $c->is_https ) {
$dn=$c->ssl_var_lookup('SSL_SERVER_S_DN');
$nsComment=$c->ssl_ext_lookup(0, '2.16.840.1.113730.1.13');
}

Apache2::ModSSL adds a few functions that are exported from mod_ssl to the Apache2::Connection class.

is_https() returns 1 if the connection is SSL-encrypted, 0 if it is not encrypted but mod_ssl is available in the apache binary or undef if mod_ssl is not loaded.
ssl_var_lookup() returns the value of an SSL variable. If mod_ssl is not loaded undef is returned. A query for an unknown variable returns an empty string.
For a list of known variables please refer to the mod_ssl documentation or mod_ssl source code (httpd-2.0.52/modules/ssl/ssl_engine_vars.c). At the time of this writing this list includes (not complete):
ssl_ext_lookup() returns the value of an SSL certificate extension. WHERE specifies whether to look in the WEB server certificate (WHERE==0) or in the client certificate (WHERE==1). OID is the Object Identifier for the extension in dotted notation, e.g. 2.16.840.1.11330.1.13 for Netscape Comment or 2.5.29.19 for X509v3 Basic Constraints.

none.

http://perl.apache.org/docs/2.0/api/Apache2/Connection.html, http://httpd.apache.org/docs-2.0/mod/mod_ssl.html

Torsten Foertsch, <torsten.foertsch@gmx.net>

Copyright (C) 2004-2008 by Torsten Foertsch
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.