aboutsummaryrefslogtreecommitdiff
path: root/urllib3/contrib
diff options
context:
space:
mode:
authorDaniele Tricoli <eriol@mornie.org>2015-10-09 23:07:31 +0200
committerDaniele Tricoli <eriol@mornie.org>2015-10-09 23:07:31 +0200
commit2b3d330a120a16e97cecd5163b5d454dcfe38a2b (patch)
tree18760addd0640c90d4e2b6e867fa504e1f14d237 /urllib3/contrib
parente6838673bda9af1e9bf7c4f71b25cf3e3dfc1253 (diff)
downloadpython-urllib3-2b3d330a120a16e97cecd5163b5d454dcfe38a2b.tar
python-urllib3-2b3d330a120a16e97cecd5163b5d454dcfe38a2b.tar.gz
Import python-urllib3_1.12.orig.tar.gz
Diffstat (limited to 'urllib3/contrib')
-rw-r--r--urllib3/contrib/pyopenssl.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/urllib3/contrib/pyopenssl.py b/urllib3/contrib/pyopenssl.py
index 19c5b4e..c20ae46 100644
--- a/urllib3/contrib/pyopenssl.py
+++ b/urllib3/contrib/pyopenssl.py
@@ -267,7 +267,7 @@ def _verify_callback(cnx, x509, err_no, err_depth, return_code):
def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
ca_certs=None, server_hostname=None,
- ssl_version=None):
+ ssl_version=None, ca_cert_dir=None):
ctx = OpenSSL.SSL.Context(_openssl_versions[ssl_version])
if certfile:
keyfile = keyfile or certfile # Match behaviour of the normal python ssl library
@@ -276,9 +276,9 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
ctx.use_privatekey_file(keyfile)
if cert_reqs != ssl.CERT_NONE:
ctx.set_verify(_openssl_verify[cert_reqs], _verify_callback)
- if ca_certs:
+ if ca_certs or ca_cert_dir:
try:
- ctx.load_verify_locations(ca_certs, None)
+ ctx.load_verify_locations(ca_certs, ca_cert_dir)
except OpenSSL.SSL.Error as e:
raise ssl.SSLError('bad ca_certs: %r' % ca_certs, e)
else: