diff --git a/catalyst/exchange/bittrex/bittrex_api.py b/catalyst/exchange/bittrex/bittrex_api.py index bc31607d..ca5f9c4a 100644 --- a/catalyst/exchange/bittrex/bittrex_api.py +++ b/catalyst/exchange/bittrex/bittrex_api.py @@ -3,11 +3,12 @@ import json import time import hmac import hashlib - +import ssl # Workaround for backwards compatibility # https://stackoverflow.com/questions/3745771/urllib-request-in-python-2-7 from six.moves import urllib + urlopen = urllib.request.urlopen @@ -48,7 +49,8 @@ class Bittrex_api(object): headers = {} req = urllib.request.Request(url, headers=headers) - response = json.loads(urlopen(req).read()) + response = json.loads(urlopen( + req, context=ssl._create_unverified_context()).read()) if response["result"]: return response["result"] diff --git a/catalyst/exchange/poloniex/poloniex_api.py b/catalyst/exchange/poloniex/poloniex_api.py index 8bf6bb83..894ba08b 100644 --- a/catalyst/exchange/poloniex/poloniex_api.py +++ b/catalyst/exchange/poloniex/poloniex_api.py @@ -3,6 +3,7 @@ import json import time import hmac import hashlib +import ssl from six.moves import urllib @@ -104,9 +105,10 @@ class Poloniex_api(object): req = urllib.request.Request( url, data=post_data, - headers=headers + headers=headers, ) - return json.loads(urlopen(req).read()) + return json.loads( + urlopen(req, context=ssl._create_unverified_context()).read()) def returnticker(self): return self.query('returnTicker', {})