def __init__(self, http_archive_fetch, custom_handlers, https_root_ca_cert_path, **kwargs): self.ca_cert_path = https_root_ca_cert_path self.HANDLER = sslproxy.wrap_handler(HttpArchiveHandler) HttpProxyServer.__init__(self, http_archive_fetch, custom_handlers, is_ssl=True, protocol='HTTPS', **kwargs) self.http_archive_fetch.http_archive.set_root_cert(https_root_ca_cert_path)
def __init__(self, http_archive_fetch, custom_handlers, https_root_ca_cert_path, **kwargs): self.ca_cert_path = https_root_ca_cert_path self.HANDLER = sslproxy.wrap_handler(HttpArchiveHandler) HttpProxyServer.__init__(self, http_archive_fetch, custom_handlers, is_ssl=True, protocol='HTTPS', **kwargs) with open(self.ca_cert_path, 'r') as cert_file: self._ca_cert_str = cert_file.read() self._host_to_cert_map = {} self._server_cert_to_cert_map = {}
def __init__(self, port, cert_file, use_sslproxy_wrapper=True, host='localhost'): if use_sslproxy_wrapper: self.HANDLER = sslproxy.wrap_handler(Handler, cert_file) else: sslproxy.set_ca_cert(cert_file) self.HANDLER = WrappedErrorHandler try: BaseHTTPServer.HTTPServer.__init__(self, (host, port), self.HANDLER) except Exception, e: raise 'Could not start HTTPSServer on port %d: %s' % (port, e)
def __init__(self, ca_cert_path, use_error_handler=False, port=0, host='localhost'): self.ca_cert_path = ca_cert_path with open(ca_cert_path, 'r') as ca_file: self.ca_cert_str = ca_file.read() self.http_archive_fetch = DummyFetch() if use_error_handler: self.HANDLER = WrappedErrorHandler else: self.HANDLER = sslproxy.wrap_handler(Handler) try: BaseHTTPServer.HTTPServer.__init__(self, (host, port), self.HANDLER) except Exception, e: raise RuntimeError('Could not start HTTPSServer on port %d: %s' % (port, e))
def __init__(self, ca_cert_path, use_error_handler=False, port=0, host='localhost'): self.ca_cert_path = ca_cert_path with open(ca_cert_path, 'r') as ca_file: ca_cert_str = ca_file.read() self.http_archive_fetch = DummyFetch(ca_cert_str) if use_error_handler: self.HANDLER = WrappedErrorHandler else: self.HANDLER = sslproxy.wrap_handler(Handler) try: BaseHTTPServer.HTTPServer.__init__(self, (host, port), self.HANDLER) except Exception, e: raise RuntimeError('Could not start HTTPSServer on port %d: %s' % (port, e))
def __init__(self, http_archive_fetch, custom_handlers, certfile, **kwargs): self.HANDLER = sslproxy.wrap_handler(HttpArchiveHandler, certfile) HttpProxyServer.__init__(self, http_archive_fetch, custom_handlers, is_ssl=True, **kwargs)