From 051d3bb601c9cb5a4b14cfc6244c680ed220f44a Mon Sep 17 00:00:00 2001 From: Leila Muhtasib Date: Tue, 10 Jul 2012 18:25:32 -0400 Subject: [PATCH 1/2] Updated documentation for SSL client cert usuage. Co-Authored By: Timnit Gebru Co-Authored By: Sarah Gonzalez Co-Authored By: Victoria Mo --- AUTHORS.rst | 4 ++++ docs/user/advanced.rst | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index dc73b64c..b1e8ec23 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -105,3 +105,7 @@ Patches and Suggestions - Danilo Bargen (gwrtheyrn) - Torsten Landschoff - Michael Holler (apotheos) +- Timnit Gebru +- Sarah Gonzalez +- Victoria Mo +- Leila Muhtasib diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 31c67601..e228bbf4 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -93,6 +93,23 @@ I don't have SSL setup on this domain, so it fails. Excellent. Github does thoug You can also pass ``verify`` the path to a CA_BUNDLE file for private certs. You can also set the ``REQUESTS_CA_BUNDLE`` environment variable. +Requests can also ignore verifying the SSL certficate if you set ``verify`` to False. + + >>> requests.get('https://kennethreitz.com', verify=False) + + +By default, ``verify`` is set to True. Option ``verify`` only applies to host certs. + +You can also specify the local cert file either as a path or key value pair:: + + >>> requests.get('https://kennethreitz.com', cert=('/path/server.crt', '/path/key')) + + +If you specify a wrong path or an invalid cert:: + + >>> requests.get('https://kennethreitz.com', cert='/wrong_path/server.pem') + SSLError: [Errno 336265225] _ssl.c:347: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib + Body Content Workflow --------------------- From 6413c063ed88244902e9ab1daea382f60ab17587 Mon Sep 17 00:00:00 2001 From: muhtasib Date: Tue, 10 Jul 2012 19:34:29 -0300 Subject: [PATCH 2/2] Fix minor formatting issue. --- docs/user/advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index e228bbf4..adda9c73 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -93,7 +93,7 @@ I don't have SSL setup on this domain, so it fails. Excellent. Github does thoug You can also pass ``verify`` the path to a CA_BUNDLE file for private certs. You can also set the ``REQUESTS_CA_BUNDLE`` environment variable. -Requests can also ignore verifying the SSL certficate if you set ``verify`` to False. +Requests can also ignore verifying the SSL certficate if you set ``verify`` to False. :: >>> requests.get('https://kennethreitz.com', verify=False)