diff options
| author | Richard van den Berg <richard.vandenberg@ncsc.nl> | 2016-08-26 09:43:11 +0200 |
|---|---|---|
| committer | Richard van den Berg <richard.vandenberg@ncsc.nl> | 2016-08-26 09:43:11 +0200 |
| commit | 2cd05271be511162b9d0c10bfb310feb623bc927 (patch) | |
| tree | 9c53a4de61dc7699209a757bc60144def909aa8d /docs/user/advanced.rst | |
| parent | 52b15f811f8ef52a144c96b8b742d734dd39d693 (diff) | |
| download | python-requests-2cd05271be511162b9d0c10bfb310feb623bc927.tar.gz | |
Add persistent examples
Diffstat (limited to 'docs/user/advanced.rst')
| -rw-r--r-- | docs/user/advanced.rst | 10 |
1 files changed, 10 insertions, 0 deletions
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')) <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') |
