fix issue on HTTP verification preference not being applied
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/27ce5053 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/27ce5053 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/27ce5053 Branch: refs/heads/trunk Commit: 27ce50530e29ab06963734d4502066b3dea2c8a8 Parents: a5d57c4 Author: Anthony Shaw <anthonys...@apache.org> Authored: Thu Jan 5 16:07:18 2017 +1100 Committer: Anthony Shaw <anthonys...@apache.org> Committed: Thu Jan 5 16:07:18 2017 +1100 ---------------------------------------------------------------------- libcloud/httplib_ssl.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/27ce5053/libcloud/httplib_ssl.py ---------------------------------------------------------------------- diff --git a/libcloud/httplib_ssl.py b/libcloud/httplib_ssl.py index e1354e2..b09799a 100644 --- a/libcloud/httplib_ssl.py +++ b/libcloud/httplib_ssl.py @@ -76,8 +76,6 @@ class LibcloudBaseConnection(object): def __init__(self): self.session = requests.Session() - self.verify = True - self.ca_cert = None def set_http_proxy(self, proxy_url): """ @@ -169,6 +167,9 @@ class LibcloudConnection(httplib.HTTPSConnection, LibcloudBaseConnection): proxy_url_env = os.environ.get(HTTP_PROXY_ENV_VARIABLE_NAME, None) proxy_url = kwargs.pop('proxy_url', proxy_url_env) + self._setup_verify() + self._setup_ca_cert() + LibcloudBaseConnection.__init__(self) if proxy_url: @@ -176,6 +177,7 @@ class LibcloudConnection(httplib.HTTPSConnection, LibcloudBaseConnection): self.session.timeout = kwargs.get('timeout', 60) def request(self, method, url, body=None, headers=None, raw=False): + import pdb; pdb.set_trace() self.response = self.session.request( method=method.lower(), url=''.join([self.host, url]), @@ -187,7 +189,7 @@ class LibcloudConnection(httplib.HTTPSConnection, LibcloudBaseConnection): ) def getresponse(self): - return self + return self.response def getheaders(self): # urlib decoded response body, libcloud has a bug