From d9cb18ad2a5dcc54a9c931d094d112be167078ba Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Wed, 18 Jan 2012 19:43:24 -0500 Subject: [PATCH 1/2] Make sure verify=False is respected for session even when there has already been a verified request to the same host. Update tests to expose the (fixed) problem. --- requests/models.py | 3 +++ test_requests_ext.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/requests/models.py b/requests/models.py index c45b18a7..957f6789 100644 --- a/requests/models.py +++ b/requests/models.py @@ -453,6 +453,9 @@ class Request(object): conn.cert_reqs = 'CERT_REQUIRED' conn.ca_certs = cert_loc + else: + conn.cert_reqs = 'CERT_NONE' + conn.ca_certs = None if not self.sent or anyway: diff --git a/test_requests_ext.py b/test_requests_ext.py index c86a383c..9e52a0d5 100644 --- a/test_requests_ext.py +++ b/test_requests_ext.py @@ -34,10 +34,10 @@ class RequestsTestSuite(unittest.TestCase): s = requests.session() - s.get('https://kennethreitz.com', verify=False) - self.assertRaises(requests.exceptions.SSLError, s.get, 'https://kennethreitz.com') + s.get('https://kennethreitz.com', verify=False) + if __name__ == '__main__': From a6ee9757a748a70f51206aa2b618aa3ef94f4394 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Wed, 18 Jan 2012 19:51:10 -0500 Subject: [PATCH 2/2] Add myself to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 1d472ea6..a21f3d1c 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -73,3 +73,4 @@ Patches and Suggestions - Lucian Ursu - Tom Moertel - Frank Kumro Jr +- Chase Sterling