Skip to content

Commit 4038afc

Browse files
Fix for https verification (#261)
* Fix for https verification - Pass 'verify=<x>' to all API calls * Bump version number to 0.17.4
1 parent ae1f228 commit 4038afc

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

inventree/api.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ def testServer(self):
196196
logger.info("Checking InvenTree server connection...")
197197

198198
try:
199-
response = requests.get(self.api_url, timeout=self.timeout, proxies=self.proxies)
199+
response = requests.get(
200+
self.api_url,
201+
timeout=self.timeout,
202+
proxies=self.proxies,
203+
verify=self.strict
204+
)
200205
except requests.exceptions.ConnectionError as e:
201206
logger.fatal(f"Server connection error: {str(type(e))}")
202207
return False
@@ -583,13 +588,15 @@ def downloadFile(self, url, destination, overwrite=False, params=None, proxies=d
583588
auth = self.auth
584589

585590
with requests.get(
586-
fullurl,
587-
stream=True,
588-
auth=auth,
589-
headers=headers,
590-
params=params,
591-
timeout=self.timeout,
592-
proxies=self.proxies) as response:
591+
fullurl,
592+
stream=True,
593+
auth=auth,
594+
headers=headers,
595+
params=params,
596+
timeout=self.timeout,
597+
proxies=self.proxies,
598+
verify=self.strict,
599+
) as response:
593600

594601
# Error code
595602
if response.status_code >= 300:

inventree/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from . import api as inventree_api
99

10-
INVENTREE_PYTHON_VERSION = "0.17.3"
10+
INVENTREE_PYTHON_VERSION = "0.17.4"
1111

1212

1313
logger = logging.getLogger('inventree')

0 commit comments

Comments
 (0)