[mod_python] mod-gnutls 'SSL_SRP_USER' and ModPython

Ambrose Andrews ambrose-bulk at vrvl.net
Sat Jul 26 07:29:16 EDT 2008

[ N.B.  i sent an identical message to the mod_gnutls list, and send it
here too now since its an issue of interaction and i don't know
precisely where the problem lies.  -AA. ]


I run Debian 'Lenny' testing with:
Apache2 v 2.2.9
Mod-Python v 3.3.1
Mod-GnuTLS v 0.5.1

I've struck some mod-gnutls specific trouble in interaction with
modpython - see this traceback:


ProcessId:      15879
Interpreter:    'CRYPTO'

ServerName:     'www.pathogens.vrvl.net'
DocumentRoot:   '/var/www/SSL_www.zed.vrvl.net/'

URI:            '/'
Location:       '/'
Directory:      None
Filename:       '/var/www/SSL_www.zed.vrvl.net/'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'django.core.handlers.modpython'

Traceback (most recent call last):

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line
1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line
1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line
1128, in _execute_target
    result = object(arg)

  File "/var/lib/python-support/python2.5/django/core/handlers/modpython.py",
line 177, in handler
    return ModPythonHandler()(req)

  File "/var/lib/python-support/python2.5/django/core/handlers/modpython.py",
line 137, in __call__

  File "/usr/lib/python2.5/os.py", line 489, in update
    self[k] = dict[k]

  File "/usr/lib/python2.5/os.py", line 474, in __setitem__
    putenv(key, item)

TypeError: putenv() argument 2 must be string, not None

So to investigate, from inside a modpython script I get this output
for str(req.subprocess_env):

 'REQUEST_URI': '/',
 'SSL_SERVER_S_AN0': 'DNSNAME:*.pathogens.vrvl.net',
 'SSL_SERVER_V_START': 'Jul 21 10:36:39 2008 EST',
'SSL_SERVER_V_END': 'Jul 21 10:36:39 2010 EST',
 'SSL_SERVER_I_DN': 'O=CAcert Inc.,OU=http://www.CAcert.org,CN=CAcert
Class 3 Root',
 'SSL_SERVER_S_DN': 'CN=*.pathogens.zed.vrvl.net',
 'SSL_SRP_USER': None,
'SSL_VERSION_INTERFACE': 'mod_gnutls/0.5.1',
'HTTPS': 'on'

and was offered the following observation in the Django irc channel:

19:47 < Magus-> aha
19:47 < Magus-> SSL_SRP_USER is being set wrong
19:48 < Magus-> it is None instead of a string like "NONE" like
19:48 < Magus-> since you can't update environ with None as an env var value
19:51 < Magus-> its probably an issue in the module though, unless its
the modpython handler replacing None with 'NONE' on the other bits


So I don't know if the problem is modpython not dealing with an exotic
environment variable it doesn't get from mod-ssl or whether it is a
mod-gnutls inconsistency.  Anyone know?


Ambrose Andrews
LPO box 8274 ANU Acton ACT 0200 Australia
mailto:ambrose at vrvl.net
xmpp:ambrose at jabber.fsfe.org
sip:znalo at ekiga.net
CE38 8B79 C0A7 DF4A 4F54 E352 2647 19A1 DB3B F823
556A 6D19 0904 827C 9DB8 3697 32D0 1E11 403F 2BE1

More information about the Mod_python mailing list