canonical / pylxd

Python module for LXD
https://pylxd.readthedocs.io/en/latest/
Apache License 2.0
251 stars 133 forks source link

Client(verify=False) is not respected #510

Open mklassen opened 2 years ago

mklassen commented 2 years ago

If verify is set to False and the environment variables REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE happen to be set, then these environment variables will override the explicit verify=False. This is because in Session.merge_environment_settings the request level verify is merged with the session level verify after the request level verify is obtained for the environment and the default for trust_env is true.

sparkiegeek commented 1 year ago

Now that https://github.com/lxc/pylxd/pull/535 has merged, you should be able to create a requests.Session, set trust_env to False and then pass it into the pylxd.Client which will help isolate you from the environment