You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I set verify to False, but it still need cerfiticate.
As we have catched ImportError, why not catch FileNotFoundError together?
Expected Result
won't Traceback
Actual Result
[root@localhost requests]# ./test-requests.py
Traceback (most recent call last):
File "/root/test/requests/./test-requests.py", line 2, in <module>
import requests
File "/usr/lib/python3.9/site-packages/requests/__init__.py", line 136, in <module>
from .api import request, get, head, post, patch, put, delete, options
File "/usr/lib/python3.9/site-packages/requests/api.py", line 13, in <module>
from . import sessions
File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 28, in <module>
from .adapters import HTTPAdapter
File "/usr/lib/python3.9/site-packages/requests/adapters.py", line 65, in <module>
_preloaded_ssl_context.load_verify_locations(
FileNotFoundError: [Errno 2] No such file or directory
Reproduction Steps
#!/usr/bin/python3
import requests
r = requests.get("http://127.0.0.1",verify=False)
print(r.text)
The text was updated successfully, but these errors were encountered:
Hi @eaglegai, certifi is a declared dependency of Requests. This should be available in all installations. We derive the the DEFAULT_CA_BUNDLE_PATH being used in this line from requests.certs.where().
Can you confirm you 1.) have certifi installed and 2.) the value of import requests; requests.certs.where()?
Hi @nateprewitt , we build a mini environment which cut off the unnecessary packages,
and in this env, we just import requests for http:// and verify is false is enough.
It's not reasonable to force to load the certificates by default, because it's not necessary in the case that verify is false.
As we consider the case that isn't built with the ssl module, why not consider the situation that 'verify is false' needn't certificates.
I set verify to False, but it still need cerfiticate.
As we have catched ImportError, why not catch FileNotFoundError together?
Expected Result
won't Traceback
Actual Result
Reproduction Steps
The text was updated successfully, but these errors were encountered: