From bbc38a953d4b6cbfde11a6a8008f162c9b60b75f Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 5 Feb 2025 16:27:47 +1100 Subject: [PATCH 1/2] Fix for https verification - Pass 'verify=' to all API calls --- inventree/api.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/inventree/api.py b/inventree/api.py index 38fe6c00..d749c922 100644 --- a/inventree/api.py +++ b/inventree/api.py @@ -196,7 +196,12 @@ def testServer(self): logger.info("Checking InvenTree server connection...") try: - response = requests.get(self.api_url, timeout=self.timeout, proxies=self.proxies) + response = requests.get( + self.api_url, + timeout=self.timeout, + proxies=self.proxies, + verify=self.strict + ) except requests.exceptions.ConnectionError as e: logger.fatal(f"Server connection error: {str(type(e))}") return False @@ -583,13 +588,15 @@ def downloadFile(self, url, destination, overwrite=False, params=None, proxies=d auth = self.auth with requests.get( - fullurl, - stream=True, - auth=auth, - headers=headers, - params=params, - timeout=self.timeout, - proxies=self.proxies) as response: + fullurl, + stream=True, + auth=auth, + headers=headers, + params=params, + timeout=self.timeout, + proxies=self.proxies, + verify=self.strict, + ) as response: # Error code if response.status_code >= 300: From 3d190744475724b833665dac9fe12c47cf2d8f8a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 5 Feb 2025 16:28:47 +1100 Subject: [PATCH 2/2] Bump version number to 0.17.4 --- inventree/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventree/base.py b/inventree/base.py index 0428bd66..26c4fc5d 100644 --- a/inventree/base.py +++ b/inventree/base.py @@ -7,7 +7,7 @@ from . import api as inventree_api -INVENTREE_PYTHON_VERSION = "0.17.3" +INVENTREE_PYTHON_VERSION = "0.17.4" logger = logging.getLogger('inventree')