Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1448

Show
Ignore:
Timestamp:
11/27/06 13:13:50
Author:
fumanchu
Message:

Fix for #605 (SSL parsing is broken).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cpwsgiserver.py

    r1446 r1448  
    791791            # X509Name objects don't seem to have a way to get the 
    792792            # complete DN string. Use str() and slice it instead. 
    793             dn = str(dn)[18:-2] 
     793            dnstr = str(dn)[18:-2] 
    794794             
    795795            wsgikey = 'SSL_SERVER_%s_DN' % prefix 
    796             self.ssl_environ[wsgikey] = dn 
     796            self.ssl_environ[wsgikey] = dnstr 
    797797             
    798             for atom in dn.split("/"): 
    799                 if atom: 
    800                     key, value = atom.split("=", 1) 
     798            # The DN should be of the form: /k1=v1/k2=v2, but we must allow 
     799            # for any value to contain slashes itself (in a URL). 
     800            while dnstr: 
     801                dnstr, value = dnstr.rsplit("=", 1) 
     802                dnstr, key = dnstr.rsplit("/", 1) 
     803                if key and value: 
    801804                    wsgikey = 'SSL_SERVER_%s_DN_%s' % (prefix, key) 
    802805                    self.ssl_environ[wsgikey] = value 

Hosted by WebFaction

Log in as guest/cpguest to create tickets