From 1e64fbcb559d3ca51790ec1e04385c5bfb625dc9 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 17 Dec 2012 13:41:20 -0500 Subject: [PATCH] CURL_CA_BUNDLE --- requests/adapters.py | 8 -------- requests/sessions.py | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/requests/adapters.py b/requests/adapters.py index 46f9d7b..4c84d06 100644 --- a/requests/adapters.py +++ b/requests/adapters.py @@ -64,14 +64,6 @@ class HTTPAdapter(BaseAdapter): if verify is not True: cert_loc = verify - # Look for configuration. - if not cert_loc and self.config.get('trust_env'): - cert_loc = os.environ.get('REQUESTS_CA_BUNDLE') - - # Curl compatibility. - if not cert_loc and self.config.get('trust_env'): - cert_loc = os.environ.get('CURL_CA_BUNDLE') - if not cert_loc: cert_loc = DEFAULT_CA_BUNDLE_PATH diff --git a/requests/sessions.py b/requests/sessions.py index b970e0d..d0b4e84 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -8,6 +8,7 @@ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ +import os from .compat import cookielib from .cookies import cookiejar_from_dict @@ -226,6 +227,15 @@ class Session(SessionRedirectMixin): if not auth: auth = get_netrc_auth(url) + # Look for configuration. + if not verify and verify is not False: + verify = os.environ.get('REQUESTS_CA_BUNDLE') + + # Curl compatibility. + if not verify and verify is not False: + verify = os.environ.get('CURL_CA_BUNDLE') + + # Merge all the kwargs. params = merge_kwargs(params, self.params) headers = merge_kwargs(headers, self.headers) -- 2.7.4