Skip to content
Myr

Add support for a directory of CAs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cory Benfield · committed by Cory Benfield · parent 4dffe5e · Browse files · 3 files+16 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+16 added−2 removed

  • other:+16 added−2 removed

3 files+16 added−2 removed

modified:docs/user/advanced.rst+1 added-1 removed
199 unmodified lines
200201 >>> requests.get('https://github.com', verify=True)202 <Response [200]>203204You can pass ``verify`` the path to a CA_BUNDLE file with certificates of trusted CAs::204You can pass ``verify`` the path to a CA_BUNDLE file or directory with certificates of trusted CAs::205206 >>> requests.get('https://github.com', verify='/path/to/certfile')207208This list of trusted CAs can also be specified through the ``REQUESTS_CA_BUNDLE`` environment variable.
687 unmodified lines
modified:requests/adapters.py+7 added-1 removed
6 unmodified lines
7This module contains the transport adapters that Requests uses to define8and maintain connections.9"""1011import os.path12import socket1314from .models import Response15from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
169 unmodified lines
185 if not cert_loc:186 raise Exception("Could not find a suitable SSL CA certificate bundle.")187188 conn.cert_reqs = 'CERT_REQUIRED'189190 if not os.path.isdir(cert_loc):188 conn.ca_certs = cert_loc191 conn.ca_certs = cert_loc192 else:193 conn.ca_cert_dir = cert_loc194 else:195 conn.cert_reqs = 'CERT_NONE'196 conn.ca_certs = None197 conn.ca_cert_dir = None198199 if cert:200 if not isinstance(cert, basestring):201 conn.cert_file = cert[0]
252 unmodified lines
modified:HISTORY.rst+8 added
1 unmodified line
23Release History4---------------56dev (XXXX)7++++++++++89**Minor Improvements** (Backwards compatible)1011- The ``verify`` keyword argument now supports being passed a path to a12 directory of CA certificates, not just a single-file bundle.13142.8.1 (2015-10-13)15++++++++++++++++++1617**Bugfixes**
1073 unmodified lines