From 2d2861ec27a290abb7ee9079c6b6374edf45b5cc Mon Sep 17 00:00:00 2001 From: Vesna Tanko Date: Mon, 6 Jan 2025 14:36:12 +0100 Subject: [PATCH] Settings: Use system certificates --- orangecanvas/application/settings.py | 3 +++ orangecanvas/config.py | 2 ++ orangecanvas/main.py | 5 +++++ setup.py | 1 + 4 files changed, 11 insertions(+) diff --git a/orangecanvas/application/settings.py b/orangecanvas/application/settings.py index 9d427d10..37299d62 100644 --- a/orangecanvas/application/settings.py +++ b/orangecanvas/application/settings.py @@ -511,6 +511,9 @@ def __setupUi(self): line_edit_https_proxy = QLineEdit() self.bind(line_edit_https_proxy, "text", "network/https-proxy") form.addRow("HTTPS proxy:", line_edit_https_proxy) + cb_use_certs = QCheckBox() + self.bind(cb_use_certs, "checked", "network/use-certs") + form.addRow("Use system certificates:", cb_use_certs) tab.setLayout(form) if self.__macUnified: diff --git a/orangecanvas/config.py b/orangecanvas/config.py index ae3a97e2..b2405712 100644 --- a/orangecanvas/config.py +++ b/orangecanvas/config.py @@ -446,6 +446,8 @@ def init(): ("network/http-proxy", str, '', 'HTTP proxy.'), ("network/https-proxy", str, '', 'HTTPS proxy.'), + + ("network/use-certs", bool, False, "Use system certificates."), ] diff --git a/orangecanvas/main.py b/orangecanvas/main.py index 6216f556..c79db2eb 100644 --- a/orangecanvas/main.py +++ b/orangecanvas/main.py @@ -439,6 +439,11 @@ def fix_set_proxy_env(): else: os.environ.pop(env_scheme, "") + if settings.value("network/use-certs", False, bool): + import truststore + + truststore.inject_into_ssl() + def fix_macos_nswindow_tabbing(): warnings.warn( diff --git a/setup.py b/setup.py index 37888807..b2234c23 100755 --- a/setup.py +++ b/setup.py @@ -39,6 +39,7 @@ "typing_extensions", "packaging", "numpy", + "truststore", )