From 2cd05271be511162b9d0c10bfb310feb623bc927 Mon Sep 17 00:00:00 2001 From: Richard van den Berg Date: Fri, 26 Aug 2016 09:43:11 +0200 Subject: [PATCH] Add persistent examples --- docs/user/advanced.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 343ba0ec..7b82d4f6 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -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. @@ -227,6 +232,11 @@ file's path:: >>> requests.get('https://kennethreitz.com', cert=('/path/client.cert', '/path/client.key')) +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')