Skip to content

Commit 1ad9bd1

Browse files
Merge pull request #83 from vossen-adobe/ssl_verify
Update to SSL Verify
2 parents 542122e + fb2e083 commit 1ad9bd1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

umapi_client/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ def __call__(self):
5454

5555

5656
class AccessRequest(object):
57-
def __init__(self, endpoint, api_key, client_secret, jwt_token):
57+
def __init__(self, endpoint, api_key, client_secret, jwt_token, ssl_verify):
5858
self.endpoint = endpoint
5959
self.api_key = api_key
6060
self.client_secret = client_secret
6161
self.jwt_token = jwt_token
6262
self.expiry = None
63+
self.ssl_verify = ssl_verify
6364

6465
def __call__(self):
6566
headers = {
@@ -72,7 +73,7 @@ def __call__(self):
7273
"jwt_token": self.jwt_token
7374
})
7475

75-
r = requests.post(self.endpoint, headers=headers, data=body)
76+
r = requests.post(self.endpoint, headers=headers, data=body, verify=self.ssl_verify)
7677
if r.status_code != 200:
7778
raise RuntimeError("Unable to authorize against {}:\n"
7879
"Response Code: {:d}, Response Text: {}\n"

umapi_client/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def _get_auth(self, ims_host, ims_endpoint_jwt,
198198
else:
199199
with open(private_key_file, 'r') as private_key_stream:
200200
jwt = JWT(self.org_id, tech_acct_id, ims_host, api_key, private_key_stream)
201-
token = AccessRequest("https://" + ims_host + ims_endpoint_jwt, api_key, client_secret, jwt())
201+
token = AccessRequest("https://" + ims_host + ims_endpoint_jwt, api_key, client_secret, jwt(), self.ssl_verify)
202202
return Auth(api_key, token())
203203

204204
def status(self, remote=False):

0 commit comments

Comments
 (0)