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

Changeset 1679

Show
Ignore:
Timestamp:
06/22/07 09:36:02
Author:
fumanchu
Message:

SSL fix.

Files:

Legend:

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

    r1677 r1679  
    130130    environ: a partial WSGI environ (server and connection entries). 
    131131        The caller MUST set the following entries: 
     132        * All wsgi.* entries 
     133        * SERVER_NAME and SERVER_PORT 
     134        * Any SSL_* entries 
     135        * Any custom entries like REMOTE_ADDR and REMOTE_PORT 
    132136        * SERVER_SOFTWARE: the value to write in the "Server" response header. 
    133137        * ACTUAL_SERVER_PROTOCOL: the value to write in the Status-Line of 
     
    605609            self.rfile.ssl_timeout = timeout 
    606610            self.sendall = _ssl_wrap_method(sock.sendall) 
    607             self.environ["wsgi.url_scheme"] = "https" 
    608             self.environ["HTTPS"] = "on" 
    609             sslenv = getattr(server, "ssl_environ", None) 
    610             if sslenv: 
    611                 self.environ.update(sslenv) 
    612611        else: 
    613612            self.rfile = sock.makefile("rb", self.rbufsize) 
     
    10611060        cert = open(self.ssl_certificate).read() 
    10621061        cert = crypto.load_certificate(crypto.FILETYPE_PEM, cert) 
    1063         self.ssl_environ = { 
     1062        ssl_environ = { 
     1063            "wsgi.url_scheme": "https", 
     1064            "HTTPS": "on", 
    10641065            # pyOpenSSL doesn't provide access to any of these AFAICT 
    10651066##            'SSL_PROTOCOL': 'SSLv2', 
     
    10701071         
    10711072        # Server certificate attributes 
    1072         self.ssl_environ.update({ 
     1073        ssl_environ.update({ 
    10731074            'SSL_SERVER_M_VERSION': cert.get_version(), 
    10741075            'SSL_SERVER_M_SERIAL': cert.get_serial_number(), 
     
    10851086             
    10861087            wsgikey = 'SSL_SERVER_%s_DN' % prefix 
    1087             self.ssl_environ[wsgikey] = dnstr 
     1088            ssl_environ[wsgikey] = dnstr 
    10881089             
    10891090            # The DN should be of the form: /k1=v1/k2=v2, but we must allow 
     
    10961097                if key and value: 
    10971098                    wsgikey = 'SSL_SERVER_%s_DN_%s' % (prefix, key) 
    1098                     self.ssl_environ[wsgikey] = value 
    1099  
    1100  
     1099                    ssl_environ[wsgikey] = value 
     1100         
     1101        self.environ.update(ssl_environ) 
     1102 

Hosted by WebFaction

Log in as guest/cpguest to create tickets