Skip to content

Commit

Permalink
improved startup of the proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-Author committed Oct 21, 2024
1 parent 305d521 commit c6b8ba8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions ontologytimemachine/custom_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion ontologytimemachine/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down

0 comments on commit c6b8ba8

Please sign in to comment.