pulp/pulp-cli

pulp_glue fails to use CA bundles specified via env vars

Closed this issue · 1 comments

Prepared Requests don't use environment variables by default. The following is needed to make it work:

from requests import Request, Session

s = Session()
req = Request('GET', url)

prepped = s.prepare_request(req)

# Merge environment settings into session
settings = s.merge_environment_settings(prepped.url, {}, None, None, None)
resp = s.send(prepped, **settings)

print(resp.status_code)

While pulp-glue calls merge_environment_settings, the settings are not actually pass to the send method. Only a portion of them are copied into the session object.

[0] https://requests.readthedocs.io/en/latest/user/advanced/#prepared-requests
[1] https://github.com/pulp/pulp-cli/blob/0.20/pulp-glue/pulp_glue/common/openapi.py#L93-L97

verify is getting set to the path of the CA bundle specified. however, it doesn't seem like it matters if the bundle is real or not. i'll close for now.