Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
else:
certifi_issue_url = 'https://github.com/certifi/python-certifi/issues/26'
if hasattr(certifi, 'old_where'): cacert_pem = certifi.old_where()
else:
cacert_pem = join(dirname(requests.certs.__file__), 'cacert.pem')
if not exists(cacert_pem):
cacert_pem = None
log.warn( 'Failed to find requests'
' certificate bundle for woraround to %s', certifi_issue_url )
if cacert_pem:
self._requests_base_keywords = (self._requests_base_keywords or dict()).copy()
self._requests_base_keywords.setdefault('verify', cacert_pem)
log.debug( 'Adjusted "requests" default ca-bundle path, to work around %s '
' [OpenSSL version %s, requests %s (>2.4.0) and certifi available at %r], to: %s',
certifi_issue_url, ssl.OPENSSL_VERSION_INFO,
requests_version, certifi.__file__, cacert_pem )
self._requests_setup_done = True
return session