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.
This commit is contained in:
Chase Sterling
2012-01-18 19:43:24 -05:00
parent 557480cfe8
commit d9cb18ad2a
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -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:
+2 -2
View File
@@ -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__':