Skip to content

Commit 154b651

Browse files
committed
Docs: clarify that Session.verify accepts a string CA bundle path (Fixes #6859)
1 parent 7029833 commit 154b651

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

docs/user/advanced.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,20 @@ man-in-the-middle (MitM) attacks. Setting verify to ``False`` may be useful
250250
during local development or testing.
251251

252252
By default, ``verify`` is set to True. Option ``verify`` only applies to host certs.
253+
When using a ``Session`` object, the ``Session.verify`` attribute accepts the same
254+
values as the ``verify`` parameter passed to ``requests.get`` and other request
255+
methods. This means it may be:
256+
257+
* ``True`` – verify the server’s TLS certificate using the system’s CA bundle (default),
258+
* ``False`` – disable TLS certificate verification entirely (INSECURE),
259+
* ``str`` – a filesystem path to a CA bundle file or directory to use instead of
260+
the system defaults.
261+
262+
For example::
263+
264+
s = requests.Session()
265+
s.verify = "/path/to/cacert.pem"
266+
s.get("https://example.com")
253267

254268
Client Side Certificates
255269
------------------------

0 commit comments

Comments
 (0)