Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions modules/RestApiClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ def __init__(self, config_section='DEFAULT', version=None, config=None):
context.check_hostname = False
check_hostname = False

# Instead of loading the default certificates load only the
# certificates specified by the user.
context.load_verify_locations(cafile=certificate_file)
if str( certificate_file ).lower() == "false":
context.verify_mode = ssl.CERT_NONE
else:
# Instead of loading the default certificates load only the
# certificates specified by the user.
context.load_verify_locations(cafile=certificate_file)
else:
if sys.version_info >= (3, 4):
# Python 3.4 and above has the improved load_default_certs()
Expand All @@ -108,7 +111,7 @@ def __init__(self, config_section='DEFAULT', version=None, config=None):

# This method is used to set up an HTTP request and send it to the server
def call_api(self, endpoint, method, headers=None, params=[], data=None,
print_request=False):
print_request=False, timeout=10):

path = self.parse_path(endpoint, params)

Expand All @@ -131,7 +134,7 @@ def call_api(self, endpoint, method, headers=None, params=[], data=None,
headers=actual_headers)

try:
response = urlopen(request, data)
response = urlopen(request, data, timeout=timeout)

response_info = response.info()
if 'Deprecated' in response_info:
Expand Down
4 changes: 2 additions & 2 deletions modules/arielapiclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class APIClient(RestApiClient):

# This class will encode any data or query parameters which will then be
# sent to the call_api() method of its inherited class.
def __init__(self, config_section='DEFAULT', config=None):
def __init__(self, config_section='DEFAULT', version='6.0', config=None):

# This version of the ariel APIClient is designed to function with
# version 6.0 of the ariel API.
self.endpoint_start = 'ariel/'
super(APIClient, self).__init__(config_section=config_section,
version='6.0', config=config)
version=version, config=config)

def get_databases(self):

Expand Down