[mod_python] apache 2.0.54 and SSLUserName

Graham Dumpleton grahamd at dscpl.com.au
Tue May 24 18:43:16 EDT 2005

Eric Jonas wrote ..
> from mod_python import apache
> import os
> def handler(req):
>     req.content_type = "text/plain"
>     outstr = "USER IS %s" % req.user
>     req.write(outstr)
>     return apache.OK
> I should get 
>    USER IS Eric M Jonas
> But instead get:
> USER IS /C=US/ST=Massachusetts/O=Massachusetts Institute of
> Technology/OU=Client CA v1/CN=Eric M Jonas/emailAddress=jonas at MIT.EDU
> This is really unfortunate because the full /C=US(etc) string sucks from
> a usability point of view, and I swear this was working in 2.0.52. Has
> anyone else experienced this sort of problem? 

Not a solution, but try a handler:

def handler(req):
  req.content_type = "text/plain"
  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.


More information about the Mod_python mailing list