def start_http_server(self):
     try:
         sock = StreamServer.get_listener((self._http_ip, self._http_port),
                                          family=socket.AF_INET)
     except socket.error as e:
         self._logger.error('Unable to open HTTP Port %d, %s' %
                            (self._http_port, e))
         sys.exit()
     else:
         self._http_port = sock.getsockname()[1]
         self._sandesh.record_port("http", self._http_port)
         self._logger.error('Starting Introspect on HTTP Port %d' %
                            self._http_port)
         if self._sandesh_config and \
                 self._sandesh_config.introspect_ssl_enable:
             ca_certs = self._sandesh_config.ca_cert
             keyfile = self._sandesh_config.keyfile
             certfile = self._sandesh_config.certfile
             self._http_server = WSGIServer(sock,
                                            self._http_app,
                                            ca_certs=ca_certs,
                                            keyfile=keyfile,
                                            certfile=certfile,
                                            ssl_version=ssl.PROTOCOL_SSLv23,
                                            cert_reqs=ssl.CERT_REQUIRED,
                                            log=self._std_log)
         else:
             self._http_server = WSGIServer(sock,
                                            self._http_app,
                                            log=self._std_log)
         self._http_server.serve_forever()
Exemplo n.º 2
0
 def start_http_server(self):
     try:
         sock = StreamServer.get_listener((SandeshHttp._HTTP_SERVER_IP,
             self._http_port), family=socket.AF_INET)
     except socket.error as e:
         self._logger.error('Unable to open HTTP Port %d, %s' %
             (self._http_port, e))
         sys.exit()
     else:
         self._http_port = sock.getsockname()[1]
         self._sandesh.record_port("http", self._http_port)
         self._logger.error('Starting Introspect on HTTP Port %d' %
             self._http_port)
         if self._sandesh_config and \
                 self._sandesh_config.introspect_ssl_enable:
             ca_certs=self._sandesh_config.ca_cert
             keyfile=self._sandesh_config.keyfile
             certfile=self._sandesh_config.certfile
             self._http_server = WSGIServer(sock, self._http_app,
                 ca_certs=ca_certs, keyfile=keyfile,
                 certfile=certfile, ssl_version=ssl.PROTOCOL_TLSv1,
                 cert_reqs=ssl.CERT_REQUIRED, log=self._std_log)
         else:
             self._http_server = WSGIServer(sock, self._http_app, log=self._std_log)
         self._http_server.serve_forever()
Exemplo n.º 3
0
 def start_http_server(self):
     try:
         sock = StreamServer.get_listener((SandeshHttp._HTTP_SERVER_IP,
             self._http_port), family=socket.AF_INET)
     except socket.error as e:
         self._logger.error('Unable to open HTTP Port %d, %s' %
             (self._http_port, e))
         sys.exit()
     else:
         self._http_port = sock.getsockname()[1]
         self._sandesh.record_port("http", self._http_port)
         self._logger.error('Starting Introspect on HTTP Port %d' %
             self._http_port)
         self._http_server = WSGIServer(sock, self._http_app)
         self._http_server.serve_forever()
Exemplo n.º 4
0
 def start_http_server(self):
     try:
         sock = StreamServer.get_listener(
             (SandeshHttp._HTTP_SERVER_IP, self._http_port),
             family=socket.AF_INET)
     except socket.error as e:
         self._logger.error('Unable to open HTTP Port %d, %s' %
                            (self._http_port, e))
         sys.exit()
     else:
         self._http_port = sock.getsockname()[1]
         self._sandesh.record_port("http", self._http_port)
         self._logger.error('Starting Introspect on HTTP Port %d' %
                            self._http_port)
         self._http_server = WSGIServer(sock, self._http_app)
         self._http_server.serve_forever()