I have a CA root certificate installed on my machine, and everything is fine when issuing requests when using the system request library installation:
$ python -c 'import requests; print requests.get("https://example.com")' <Response [200]>
However, if I issue the same request from a virtual environment, certificate verification fails:
$ python -c 'import requests; print requests.get("https://example.com")' requests.exceptions.SSLError: [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Using requests.certs.where , I see that the system installation uses a set of system CAs, and the virtual environment uses a set of CAs that comes with requests:
$ python -c "import requests; print requests.certs.where()" /etc/ssl/certs/ca-certificates.crt $ (venv) python -c "import requests; print requests.certs.where()" .../venv/local/lib/python2.7/site-packages/requests/cacert.pem
Is there another solution for collecting system certificates without specifying a path for each request when using virtualenv , ie:
>>> requests.get("https://example.com" verify="/etc/ssl/certs/ca-certificates.crt")
source share