def WSGIServer(server_address, wsgi_app):
 import wsgiserver
 wsgiserver.ssl_adapters = {'builtin': 'web.wsgiserver.ssl_builtin.BuiltinSSLAdapter', 'pyopenssl': 'web.wsgiserver.ssl_pyopenssl.pyOpenSSLAdapter'}
 server = wsgiserver.CherryPyWSGIServer(server_address, wsgi_app, server_name='localhost')
 def create_ssl_adapter(cert, key):
  import types
  cherrypy = types.ModuleType('cherrypy')
  cherrypy.wsgiserver = wsgiserver
  sys.modules['cherrypy'] = cherrypy
  sys.modules['cherrypy.wsgiserver'] = wsgiserver
  from wsgiserver.ssl_pyopenssl import pyOpenSSLAdapter
  adapter = pyOpenSSLAdapter(cert, key)
  del sys.modules['cherrypy']
  del sys.modules['cherrypy.wsgiserver']
  return adapter
 if ((server.ssl_adapter is None) and getattr(server, 'ssl_certificate', None) and getattr(server, 'ssl_private_key', None)):
  server.ssl_adapter = create_ssl_adapter(server.ssl_certificate, server.ssl_private_key)
 server.nodelay = (not sys.platform.startswith('java'))
 return server

def WSGIServer ( server_address , wsgi_app ) : import wsgiserver wsgiserver . ssl_adapters = { 'builtin' : 'web.wsgiserver.ssl_builtin.BuiltinSSLAdapter' , 'pyopenssl' : 'web.wsgiserver.ssl_pyopenssl.pyOpenSSLAdapter' } server = wsgiserver . CherryPyWSGIServer ( server_address , wsgi_app , server_name = 'localhost' ) def create_ssl_adapter ( cert , key ) : import types cherrypy = types . ModuleType ( 'cherrypy' ) cherrypy . wsgiserver = wsgiserver sys . modules [ 'cherrypy' ] = cherrypy sys . modules [ 'cherrypy.wsgiserver' ] = wsgiserver from wsgiserver . ssl_pyopenssl import pyOpenSSLAdapter adapter = pyOpenSSLAdapter ( cert , key ) del sys . modules [ 'cherrypy' ] del sys . modules [ 'cherrypy.wsgiserver' ] return adapter if ( ( server . ssl_adapter is None ) and getattr ( server , 'ssl_certificate' , None ) and getattr ( server , 'ssl_private_key' , None ) ) : server . ssl_adapter = create_ssl_adapter ( server . ssl_certificate , server . ssl_private_key ) server . nodelay = ( not sys . platform . startswith ( 'java' ) ) return server
creates cherrypy wsgi server listening at server_address to serve wsgi_app .