Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 01d9ae0

Browse files
author
Josh Watts
committed
fixed Python 3 bug with disable certificate validation in httplib2
1 parent 2ba69fe commit 01d9ae0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

instagram/oauth2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from six.moves.urllib.parse import urlencode
33
from httplib2 import Http
44
import mimetypes
5+
import six
56

67

78
class OAuth2AuthExchangeError(Exception):
@@ -208,5 +209,8 @@ def make_request(self, url, method="GET", body=None, headers=None):
208209
headers = headers or {}
209210
if not 'User-Agent' in headers:
210211
headers.update({"User-Agent": "%s Python Client" % self.api.api_name})
212+
# https://github.com/jcgregorio/httplib2/issues/173
213+
# bug in httplib2 w/ Python 3 and disable_ssl_certificate_validation=True
214+
http_obj = Http() if six.PY3 else Http(disable_ssl_certificate_validation=True)
211215
http_obj = Http(disable_ssl_certificate_validation=True)
212216
return http_obj.request(url, method, body=body, headers=headers)

0 commit comments

Comments
 (0)