Skip to content
Myr

Make sure verify=False is respected for session even when there has already been a verified request to the same host.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Update tests to expose the (fixed) problem.

authored by Chase Sterling · committed by Chase Sterling · parent 557480c · Browse files · 2 files+5 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−2 removed

  • other:+5 added−2 removed

2 files+5 added−2 removed

modified:requests/models.py+3 added
451 unmodified lines
452 cert_loc = __import__('certifi').where()453454 conn.cert_reqs = 'CERT_REQUIRED'455 conn.ca_certs = cert_loc456 else:457 conn.cert_reqs = 'CERT_NONE'458 conn.ca_certs = None459460 if not self.sent or anyway:461462 if self.cookies:
248 unmodified lines
modified:test_requests_ext.py+2 added-2 removed
32 unmodified lines
33 def test_ssl_hostname_session_not_ok(self):3435 s = requests.session()3637 s.get('https://kennethreitz.com', verify=False)3837 self.assertRaises(requests.exceptions.SSLError, s.get, 'https://kennethreitz.com')3839 s.get('https://kennethreitz.com', verify=False)40414243if __name__ == '__main__':44 unittest.main()45