Commit 6912709b by x

Fix ssl_verify

parent ba97bf0e
...@@ -20,23 +20,23 @@ class StoreApi: ...@@ -20,23 +20,23 @@ class StoreApi:
headers = {'content-type': 'application/json'} headers = {'content-type': 'application/json'}
if settings['ssl_auth'] == 'True' and settings['basic_auth'] == 'True': if settings['ssl_auth'] == 'True' and settings['basic_auth'] == 'True':
r = requests.post(url, data=payload, headers=headers, \ r = requests.post(url, data=payload, headers=headers, \
verify = settings['verify_ssl'], \ verify = settings['verify_ssl']=='True', \
cert=(settings['store_client_cert'], settings['store_client_key']), \ cert=(settings['store_client_cert'], settings['store_client_key']), \
auth=(settings['store_client_user'], settings['store_client_pass']) auth=(settings['store_client_user'], settings['store_client_pass'])
) )
elif settings['ssl_auth'] == 'True': elif settings['ssl_auth'] == 'True':
r = requests.post(url, data=payload, headers=headers, \ r = requests.post(url, data=payload, headers=headers, \
verify = settings['verify_ssl'], \ verify = settings['verify_ssl']=='True', \
cert=(settings['store_client_cert'], settings['store_client_key']) \ cert=(settings['store_client_cert'], settings['store_client_key']) \
) )
elif settings['basic_auth'] == 'True': elif settings['basic_auth'] == 'True':
r = requests.post(url, data=payload, headers=headers, \ r = requests.post(url, data=payload, headers=headers, \
verify = settings['verify_ssl'], \ verify = settings['verify_ssl']=='True', \
auth=(settings['store_client_user'], settings['store_client_pass']) \ auth=(settings['store_client_user'], settings['store_client_pass']) \
) )
else: else:
r = requests.post(url, data=payload, headers=headers, \ r = requests.post(url, data=payload, headers=headers, \
verify = settings['verify_ssl'] \ verify = settings['verify_ssl']=='True' \
) )
return r return r
@staticmethod @staticmethod
...@@ -44,23 +44,23 @@ class StoreApi: ...@@ -44,23 +44,23 @@ class StoreApi:
headers = {'content-type': 'application/json'} headers = {'content-type': 'application/json'}
if settings['ssl_auth'] == 'True' and settings['basic_auth'] == 'True': if settings['ssl_auth'] == 'True' and settings['basic_auth'] == 'True':
r = requests.get(url, headers=headers, \ r = requests.get(url, headers=headers, \
verify = settings['verify_ssl'], \ verify = settings['verify_ssl']=='True', \
cert=(settings['store_client_cert'], settings['store_client_key']), \ cert=(settings['store_client_cert'], settings['store_client_key']), \
auth=(settings['store_client_user'], settings['store_client_pass']) auth=(settings['store_client_user'], settings['store_client_pass'])
) )
elif settings['ssl_auth'] == 'True': elif settings['ssl_auth'] == 'True':
r = requests.get(url, headers=headers, \ r = requests.get(url, headers=headers, \
verify = settings['verify_ssl'], \ verify = settings['verify_ssl']=='True', \
cert=(settings['store_client_cert'], settings['store_client_key']) \ cert=(settings['store_client_cert'], settings['store_client_key']) \
) )
elif settings['basic_auth'] == 'True': elif settings['basic_auth'] == 'True':
r = requests.get(url, headers=headers, \ r = requests.get(url, headers=headers, \
verify = settings['verify_ssl'], \ verify = settings['verify_ssl']=='True', \
auth=(settings['store_client_user'], settings['store_client_pass']) \ auth=(settings['store_client_user'], settings['store_client_pass']) \
) )
else: else:
r = requests.get(url, headers=headers, \ r = requests.get(url, headers=headers, \
verify = settings['verify_ssl'] \ verify = settings['verify_ssl']=='True' \
) )
return r return r
@staticmethod @staticmethod
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment