Skip to content
Myr

Add persistent examples

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

authored by Richard van den Berg · committed by Richard van den Berg · parent 52b15f8 · Browse files · 1 file+10 added−0 removed
This commit

State

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

Diff stats

1 file+10 added−0 removed

  • other:+10 added−0 removed

1 file+10 added−0 removed

modified:docs/user/advanced.rst+10 added
206 unmodified lines
207You can pass ``verify`` the path to a CA_BUNDLE file or directory with certificates of trusted CAs::208209 >>> requests.get('https://github.com', verify='/path/to/certfile')210211or persistent::212213 s = requests.Session()214 s.verify = '/path/to/certfile'215216.. note:: If ``verify`` is set to a path to a directory, the directory must have been processed using217 the c_rehash utility supplied with OpenSSL.218219This list of trusted CAs can also be specified through the ``REQUESTS_CA_BUNDLE`` environment variable.
11 unmodified lines
231232 >>> requests.get('https://kennethreitz.com', cert=('/path/client.cert', '/path/client.key'))233 <Response [200]>234235or persistent::236237 s = requests.Session()238 s.cert = '/path/client.cert'239240If you specify a wrong path or an invalid cert, you'll get a SSLError::241242 >>> requests.get('https://kennethreitz.com', cert='/wrong_path/client.pem')243 SSLError: [Errno 336265225] _ssl.c:347: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib
713 unmodified lines