Merge branch 'kaptajnen-master'

This commit is contained in:
Cory Benfield
2017-05-18 09:05:03 -07:00
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -241,6 +241,7 @@ class HTTPAdapter(BaseAdapter):
conn.key_file = cert[1]
else:
conn.cert_file = cert
conn.key_file = None
if conn.cert_file and not os.path.exists(conn.cert_file):
raise IOError("Could not find the TLS certificate file, "
"invalid path: {0}".format(conn.cert_file))
+4
View File
@@ -786,6 +786,10 @@ class TestRequests:
requests.get(httpbin_secure(), cert=('.', INVALID_PATH))
assert str(e.value) == 'Could not find the TLS key file, invalid path: {0}'.format(INVALID_PATH)
def test_http_with_certificate(self, httpbin):
r = requests.get(httpbin(), cert='.')
assert r.status_code == 200
def test_https_warnings(self, httpbin_secure, httpbin_ca_bundle):
"""warnings are emitted with requests.get"""
if HAS_MODERN_SSL or HAS_PYOPENSSL: