From c6b8ba838a0600382648d34d7bdba9924d8a260e Mon Sep 17 00:00:00 2001 From: "jj-author@users.noreply.github.com" Date: Mon, 21 Oct 2024 09:57:33 +0200 Subject: [PATCH] improved startup of the proxy --- ontologytimemachine/custom_proxy.py | 26 +++++++++++++------------- ontologytimemachine/utils/config.py | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ontologytimemachine/custom_proxy.py b/ontologytimemachine/custom_proxy.py index bb13590..2ecb9d6 100644 --- a/ontologytimemachine/custom_proxy.py +++ b/ontologytimemachine/custom_proxy.py @@ -175,25 +175,25 @@ def queue_response(self, response): sys.argv = [sys.argv[0]] - # check it https interception is enabled + # check it https interception is enabled add the necessary certificates to proxypy if config.httpsInterception != (HttpsInterception.NONE or HttpsInterception.BLOCK): sys.argv += [ - "--ca-key-file", - "ca-key.pem", - "--ca-cert-file", - "ca-cert.pem", - "--ca-signing-key-file", - "ca-signing-key.pem", + "--ca-key-file", "ca-key.pem", + "--ca-cert-file", "ca-cert.pem", + "--ca-signing-key-file", "ca-signing-key.pem", ] sys.argv += [ - "--hostname", - config.host, - "--port", - config.port, - "--plugins", - __name__ + ".OntologyTimeMachinePlugin", + "--hostname", config.host, + "--port", config.port, + # "--log-level", config.logLevel.name, + '--insecure-tls-interception', # without it the proxy would not let through a response using an invalid upstream certificate in interception mode + # since there currently is a bug in proxypy when a connect request uses an IP address instead of a domain name + # the proxy would not be able to work corectly in transparent mode using 3proxy setup since it tries to match + # the IP address as hostname with the certificate instead of the domain name in the SNI field + "--plugins", __name__ + ".OntologyTimeMachinePlugin", ] logger.info("Starting OntologyTimeMachineProxy server...") + logger.debug(f"starting proxypy engine with arguments: {sys.argv}") proxy.main() diff --git a/ontologytimemachine/utils/config.py b/ontologytimemachine/utils/config.py index c53f700..6786894 100644 --- a/ontologytimemachine/utils/config.py +++ b/ontologytimemachine/utils/config.py @@ -100,7 +100,7 @@ def enum_parser(enum_class: Type[E], value: str) -> E: def parse_arguments(config_str: str = "") -> Config: default_cfg: Config = Config() parser = argparse.ArgumentParser( - description="Process ontology format and version.", + description="Ontology Time Machine Proxy powered by DBpedia Archivo", formatter_class=argparse.ArgumentDefaultsHelpFormatter, )