@@ -46,6 +46,7 @@ def __init__(self, host=None, **kwargs):
4646 token-name - Name of the token to use (default = 'inventree-python-client')
4747 use_token_auth - Use token authentication? (default = True)
4848 verbose - Print extra debug messages (default = False)
49+ strict - Enforce strict HTTPS certificate checking (default = True)
4950 timeout - Set timeout to use (in seconds). Default: 10
5051 proxies - Definition of proxies as a dict (defaults to an empty dict)
5152
@@ -66,6 +67,7 @@ def __init__(self, host=None, **kwargs):
6667 self .token_name = kwargs .get ('token_name' , os .environ .get ('INVENTREE_API_TOKEN_NAME' , 'inventree-python-client' ))
6768 self .timeout = kwargs .get ('timeout' , os .environ .get ('INVENTREE_API_TIMEOUT' , 10 ))
6869 self .proxies = kwargs .get ('proxies' , dict ())
70+ self .strict = bool (kwargs .get ('strict' , True ))
6971
7072 self .use_token_auth = kwargs .get ('use_token_auth' , True )
7173 self .verbose = kwargs .get ('verbose' , False )
@@ -326,6 +328,9 @@ def request(self, api_url, **kwargs):
326328 else :
327329 payload ['json' ] = data
328330
331+ # Enforce strict HTTPS certificate checking?
332+ payload ['verify' ] = self .strict
333+
329334 # Debug request information
330335 logger .debug ("Sending Request:" )
331336 logger .debug (f" - URL: { method } { api_url } " )
0 commit comments