Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Add persistent examples
Browse files Browse the repository at this point in the history
  • Loading branch information
RichieB2B committed Aug 26, 2016
1 parent 52b15f8 commit 2cd0527
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/user/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ You can pass ``verify`` the path to a CA_BUNDLE file or directory with certifica

>>> requests.get('https://github.com', verify='/path/to/certfile')

or persistent::

s = requests.Session()
s.verify = '/path/to/certfile'

.. note:: If ``verify`` is set to a path to a directory, the directory must have been processed using
the c_rehash utility supplied with OpenSSL.

Expand All @@ -227,6 +232,11 @@ file's path::
>>> requests.get('https://kennethreitz.com', cert=('/path/client.cert', '/path/client.key'))
<Response [200]>

or persistent::

s = requests.Session()
s.cert = '/path/client.cert'

If you specify a wrong path or an invalid cert, you'll get a SSLError::

>>> requests.get('https://kennethreitz.com', cert='/wrong_path/client.pem')
Expand Down

0 comments on commit 2cd0527

Please sign in to comment.