mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge branch 'kaptajnen-master'
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user