Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use requests library to resolve SSL errors. #1450

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Use requests library to resolve SSL errors. #1450

merged 1 commit into from
Jan 14, 2025

Conversation

robinjhuang
Copy link
Collaborator

Was getting some errors when installing custom nodes from registry on macOS:

  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 1347, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>
^C

Currently, we use torchvision's util download function, which uses urllib3 to download files from a URL. However, that library only uses CPython's default bundled trusted certs which are not always complete. The requestslibrary uses certifi by default and I was able to resolve this issue by switching to it.

Ref: https://requests.readthedocs.io/en/latest/user/advanced/#ca-certificates

Requests uses certificates from the package [certifi](https://certifiio.readthedocs.io/).

@robinjhuang robinjhuang requested a review from ltdrdata January 13, 2025 20:45
@ltdrdata ltdrdata merged commit f63205f into main Jan 14, 2025
2 checks passed
@ltdrdata ltdrdata deleted the rh-ssl branch January 14, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants