grr/server/grr_response_server/gui/wsgiapp_testlib.py
def run(self):
    """Run the WSGI server in a thread."""
    logging.info("Listening on port %d.", self.port)

    ssl_context = None
    if config.CONFIG["AdminUI.enable_ssl"]:
      cert_file = config.CONFIG["AdminUI.ssl_cert_file"]
      if not cert_file:
        raise ValueError("Need a valid cert file to enable SSL.")

      key_file = config.CONFIG["AdminUI.ssl_key_file"]
      if not key_file:
        raise ValueError("Need a valid key file to enable SSL.")

      ssl_context = (cert_file, key_file)

    # Werkzeug only handles IPv6 if ":" is in the host (i.e. we pass
    # an IPv6 ip).
    ip = utils.ResolveHostnameToIP("localhost", self.port)
    self.server = serving.make_server(
        ip,
        self.port,
        wsgiapp.AdminUIApp().WSGIHandler(),
        ssl_context=ssl_context)

    # We want to notify other threads that we are now ready to serve right
    # before we enter the serving loop.
    self.ready_to_serve.set()
    while self.keep_running:
      self.server.handle_request()
Run the WSGI server in a thread.
Run the WSGI server in a thread.
Run the WSGI server in a thread .
def run(self):
    logging.info("Listening on port %d.", self.port)
    ssl_context = None
    if config.CONFIG["AdminUI.enable_ssl"]:
      cert_file = config.CONFIG["AdminUI.ssl_cert_file"]
      if not cert_file:
        raise ValueError("Need a valid cert file to enable SSL.")
      key_file = config.CONFIG["AdminUI.ssl_key_file"]
      if not key_file:
        raise ValueError("Need a valid key file to enable SSL.")
      ssl_context = (cert_file, key_file)
    ip = utils.ResolveHostnameToIP("localhost", self.port)
    self.server = serving.make_server(
        ip,
        self.port,
        wsgiapp.AdminUIApp().WSGIHandler(),
        ssl_context=ssl_context)
    self.ready_to_serve.set()
    while self.keep_running:
      self.server.handle_request()
def run ( self ) : logging . info ( "Listening on port %d." , self . port ) ssl_context = None if config . CONFIG [ "AdminUI.enable_ssl" ] : cert_file = config . CONFIG [ "AdminUI.ssl_cert_file" ] if not cert_file : raise ValueError ( "Need a valid cert file to enable SSL." ) key_file = config . CONFIG [ "AdminUI.ssl_key_file" ] if not key_file : raise ValueError ( "Need a valid key file to enable SSL." ) ssl_context = ( cert_file , key_file ) ip = utils . ResolveHostnameToIP ( "localhost" , self . port ) self . server = serving . make_server ( ip , self . port , wsgiapp . AdminUIApp ( ) . WSGIHandler ( ) , ssl_context = ssl_context ) self . ready_to_serve . set ( ) while self . keep_running : self . server . handle_request ( )
Run the WSGI server in a thread.
Run the WSGI server in a thread .
"""Run the WSGI server in a thread.""" # Werkzeug only handles IPv6 if ":" is in the host (i.e. we pass # an IPv6 ip). # We want to notify other threads that we are now ready to serve right # before we enter the serving loop.
self