mirror of
https://github.com/empayre/OTX-Python-SDK.git
synced 2024-11-06 09:55:20 +00:00
Modified requests to optionally allow the verify and cert parameters for proxies
This commit is contained in:
parent
b3f07db50c
commit
98e177b37f
10
OTXv2.py
10
OTXv2.py
@ -93,9 +93,11 @@ class OTXv2(object):
|
||||
Main class to interact with the AlienVault OTX API.
|
||||
"""
|
||||
|
||||
def __init__(self, api_key, proxy=None, proxy_https=None, server="https://otx.alienvault.com", project="SDK", user_agent=None):
|
||||
def __init__(self, api_key, proxy=None, proxy_https=None, server="https://otx.alienvault.com", project="SDK", user_agent=None, verify="", cert=""):
|
||||
self.key = api_key
|
||||
self.server = server
|
||||
self.verify = verify
|
||||
self.cert = cert
|
||||
|
||||
self.proxies = {}
|
||||
if proxy:
|
||||
@ -174,6 +176,8 @@ class OTXv2(object):
|
||||
self.create_url(url, **kwargs),
|
||||
headers=self.headers,
|
||||
proxies=self.proxies,
|
||||
verify=self.verify,
|
||||
cert=self.cert,
|
||||
)
|
||||
return self.handle_response_errors(response).json()
|
||||
except requests.exceptions.RetryError:
|
||||
@ -192,6 +196,8 @@ class OTXv2(object):
|
||||
data=json.dumps(body),
|
||||
headers=self.headers,
|
||||
proxies=self.proxies,
|
||||
verify=self.verify,
|
||||
cert=self.cert,
|
||||
)
|
||||
return self.handle_response_errors(response).json()
|
||||
|
||||
@ -211,6 +217,8 @@ class OTXv2(object):
|
||||
files=files,
|
||||
headers=headers or self.headers,
|
||||
proxies=self.proxies,
|
||||
verify=self.verify,
|
||||
cert=self.cert,
|
||||
)
|
||||
return self.handle_response_errors(response).json()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user