diff options
author | pje <none@none> | 2013-05-05 14:35:27 -0400 |
---|---|---|
committer | pje <none@none> | 2013-05-05 14:35:27 -0400 |
commit | 430529414dec7264d11400d2c1bd8a207ee76904 (patch) | |
tree | cf1d2740b2e1de1e67d35ae4c64cedc75fabd7ec | |
parent | d6faaf34a953d9c30c9c64c4038470881958ddc1 (diff) | |
download | external_python_setuptools-430529414dec7264d11400d2c1bd8a207ee76904.tar.gz external_python_setuptools-430529414dec7264d11400d2c1bd8a207ee76904.tar.bz2 external_python_setuptools-430529414dec7264d11400d2c1bd8a207ee76904.zip |
Add support for fallback to 'certifi' module, if installed+active.
(grafted from 4a183cf275264653005072be25a644273463ba83)
--HG--
branch : setuptools-0.6
extra : source : 4a183cf275264653005072be25a644273463ba83
-rwxr-xr-x | setup.py | 4 | ||||
-rw-r--r-- | setuptools.egg-info/dependency_links.txt | 1 | ||||
-rw-r--r-- | setuptools.egg-info/requires.txt | 3 | ||||
-rw-r--r-- | setuptools/ssl_support.py | 14 |
4 files changed, 13 insertions, 9 deletions
@@ -95,8 +95,10 @@ setup( "ssl:sys_platform=='win32'": "wincertstore==0.1", "ssl:sys_platform=='win32' and python_version in '2.3, 2.4'": "ctypes==1.0.2", "ssl:python_version in '2.3, 2.4, 2.5'":"ssl==1.16", + "certs": "certifi==0.0.8", }, dependency_links = [ + 'http://pypi.python.org/packages/source/c/certifi/certifi-0.0.8.tar.gz#md5=dc5f5e7f0b5fc08d27654b17daa6ecec', 'http://pypi.python.org/packages/source/s/ssl/ssl-1.16.tar.gz#md5=fb12d335d56f3c8c7c1fefc1c06c4bfb', 'http://pypi.python.org/packages/source/w/wincertstore/wincertstore-0.1.zip#md5=2f9accbebe8f7b4c06ac7aa83879b81c', 'http://sourceforge.net/projects/ctypes/files/ctypes/1.0.2/ctypes-1.0.2.win32-py2.3.exe/download#md5=9afe4b75240a8808a24df7a76b6081e3', @@ -119,5 +121,3 @@ setup( - - diff --git a/setuptools.egg-info/dependency_links.txt b/setuptools.egg-info/dependency_links.txt index a659a050..d490c300 100644 --- a/setuptools.egg-info/dependency_links.txt +++ b/setuptools.egg-info/dependency_links.txt @@ -1,3 +1,4 @@ +http://pypi.python.org/packages/source/c/certifi/certifi-0.0.8.tar.gz#md5=dc5f5e7f0b5fc08d27654b17daa6ecec http://pypi.python.org/packages/source/s/ssl/ssl-1.16.tar.gz#md5=fb12d335d56f3c8c7c1fefc1c06c4bfb http://pypi.python.org/packages/source/w/wincertstore/wincertstore-0.1.zip#md5=2f9accbebe8f7b4c06ac7aa83879b81c http://sourceforge.net/projects/ctypes/files/ctypes/1.0.2/ctypes-1.0.2.win32-py2.3.exe/download#md5=9afe4b75240a8808a24df7a76b6081e3 diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index 517f15d8..9ddbc5ac 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -3,6 +3,9 @@ [ssl:sys_platform=='win32'] wincertstore==0.1 +[certs] +certifi==0.0.8 + [ssl:sys_platform=='win32' and python_version in '2.3, 2.4'] ctypes==1.0.2 diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py index fe9d5df2..f1d8c920 100644 --- a/setuptools/ssl_support.py +++ b/setuptools/ssl_support.py @@ -1,4 +1,5 @@ import sys, os, socket, urllib2, atexit, re +from pkg_resources import ResolutionError, ExtractionError try: import ssl @@ -38,7 +39,6 @@ is_available = ssl is not None and object not in (HTTPSHandler, HTTPSConnection) - try: from socket import create_connection except ImportError: @@ -225,7 +225,8 @@ def get_win_certfile(): _wincerts = MyCertFile(stores=['CA', 'ROOT']) return _wincerts.name - + + def find_ca_bundle(): """Return an existing CA bundle path, or None""" if os.name=='nt': @@ -234,11 +235,10 @@ def find_ca_bundle(): for cert_path in cert_paths: if os.path.isfile(cert_path): return cert_path - - - - - + try: + return pkg_resources.resource_filename('certifi', 'cacert.pem') + except (ImportError, ResolutionError, ExtractionError): + return None |