python-requests/no-default-cacert.patch

61 lines
2.4 KiB
Diff
Raw Normal View History

Index: requests-2.12.4/MANIFEST.in
===================================================================
--- requests-2.12.4.orig/MANIFEST.in
+++ requests-2.12.4/MANIFEST.in
@@ -1 +1 @@
-include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt requests/cacert.pem
+include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt
Index: requests-2.12.4/requests/adapters.py
===================================================================
--- requests-2.12.4.orig/requests/adapters.py
+++ requests-2.12.4/requests/adapters.py
@@ -213,15 +213,13 @@ class HTTPAdapter(BaseAdapter):
if verify is not True:
cert_loc = verify
- if not cert_loc:
- cert_loc = DEFAULT_CA_BUNDLE_PATH
-
- if not cert_loc:
- raise Exception("Could not find a suitable SSL CA certificate bundle.")
-
conn.cert_reqs = 'CERT_REQUIRED'
- if not os.path.isdir(cert_loc):
+ if cert_loc is None:
+ # use default context
+ conn.ca_certs = None
+ conn.ca_cert_dir = None
+ elif not os.path.isdir(cert_loc):
conn.ca_certs = cert_loc
else:
conn.ca_cert_dir = cert_loc
Index: requests-2.12.4/requests/certs.py
===================================================================
--- requests-2.12.4.orig/requests/certs.py
+++ requests-2.12.4/requests/certs.py
@@ -18,8 +18,9 @@ try:
except ImportError:
def where():
"""Return the preferred certificate bundle."""
- # vendored bundle inside Requests
- return os.path.join(os.path.dirname(__file__), 'cacert.pem')
+ # in openSUSE we rely on ca-certificates instead of
+ # having an another bundle
+ return '/etc/ssl/ca-bundle.pem'
if __name__ == '__main__':
print(where())
diff -rupN requests-2.10.0.orig/setup.py requests-2.10.0/setup.py
--- requests-2.10.0.orig/setup.py 2016-04-29 18:03:18.000000000 -0400
+++ requests-2.10.0/setup.py 2016-06-03 01:17:13.549030517 -0400
@@ -68,7 +68,7 @@ setup(
author_email='me@kennethreitz.com',
url='http://python-requests.org',
packages=packages,
- package_data={'': ['LICENSE', 'NOTICE'], 'requests': ['*.pem']},
+ package_data={'': ['LICENSE', 'NOTICE']},
package_dir={'requests': 'requests'},
include_package_data=True,
install_requires=requires,