Properly pass the CA to requests
We store the CA in request.cert, but it's not compatible with a cert. To pass the CA to requests, we need to set the verify argument. Change-Id: Id0f39e3253b1486db8ae2da3d7dc6c0fdb41062a
This commit is contained in:
parent
9bedf4d26f
commit
13e90a0ab5
@ -63,8 +63,7 @@ class TestHttpTransport(base.TestBase):
|
||||
params=final_params,
|
||||
headers=final_headers,
|
||||
data=None,
|
||||
verify=True,
|
||||
cert=None)
|
||||
verify=True)
|
||||
|
||||
@mock.patch.object(prequest.packages.urllib3.response.HTTPResponse,
|
||||
'stream')
|
||||
@ -91,8 +90,7 @@ class TestHttpTransport(base.TestBase):
|
||||
params=params,
|
||||
headers=final_headers,
|
||||
data=None,
|
||||
verify=True,
|
||||
cert=None)
|
||||
verify=True)
|
||||
|
||||
@mock.patch.object(prequest.packages.urllib3.response.HTTPResponse,
|
||||
'stream')
|
||||
|
@ -89,13 +89,19 @@ class HttpTransport(base.Transport):
|
||||
if osprofiler_web:
|
||||
headers.update(osprofiler_web.get_trace_id_headers())
|
||||
|
||||
if request.verify:
|
||||
if request.cert:
|
||||
verify = request.cert
|
||||
else:
|
||||
verify = True
|
||||
else:
|
||||
verify = False
|
||||
resp = self.client.request(method,
|
||||
url=url,
|
||||
params=request.params,
|
||||
headers=headers,
|
||||
data=request.content,
|
||||
verify=request.verify,
|
||||
cert=request.cert)
|
||||
verify=verify)
|
||||
|
||||
if resp.status_code in self.http_to_zaqar:
|
||||
kwargs = {}
|
||||
|
Loading…
Reference in New Issue
Block a user