[mod_python] apache 2.0.54 and SSLUserName

Graham Dumpleton grahamd at dscpl.com.au
Tue May 24 21:09:06 EDT 2005

Eric Jonas wrote ..
> > Not a solution, but try a handler:
> > 
> > def handler(req):
> >   req.add_common_vars()
> >   req.content_type = "text/plain"
> >   req.send_http_header()
> >   for name in req.subprocess_env.keys():
> >     print >> req, name, req.subprocess_env[name]
> >   return apache.OK
> > 
> > You might find that the specific bit of information you are after is
> in one of
> > the SSL variables which are populated into the req.subprocess_env table
> > thus giving you an alternate way of finding it.
> Alas, I still get:
> REMOTE_USER /C=US/ST=Massachusetts/O=Massachusetts Institute of
> Technology/OU=Client CA v1/CN=Eric M Jonas/emailAddress=jonas at MIT.EDU

These aren't the variables I am thinking of. If the handler is executed as
a content handler (not earlier phases) and mod_ssl is being used, there
should be a host of "SSL_*" variables available. The list is at the end of
this email. It is these variables I was suggesting may have just the specific
bit you want as a separate item.

Unfortunately, if you are trying to get the information in a authhandler
you will not have access to them as they are only populated by the SSL
fixup handler. There is also no gaurantee that the SSL fixuphandler is
run before a mod_python fixuphandler, so you can't even attempt to
access it from the mod_python fixuphandler.

This issue was recently talked about on the mailing list so you may want
to review the discussion in the mailing list archive, starting with:


In the last quoted message I posted code (untested), that may allow you
to access all these SSL variables from an earlier handler than the content
handler. if you needed to do it from the authhandler. The URLs for the
attachments are broken though. I think those which will work are:


If they don't, let me know and will send files to you.

Anyway, this is on the basis that you are in fact relying on mod_ssl.

Below are all the SSL variables.

static const char *ssl_hook_Fixup_vars[] = {

More information about the Mod_python mailing list