Skip to content

Use requests library to resolve SSL errors.#1450

Merged
ltdrdata merged 1 commit intomainfrom
rh-ssl
Jan 14, 2025
Merged

Use requests library to resolve SSL errors.#1450
ltdrdata merged 1 commit intomainfrom
rh-ssl

Conversation

@robinjhuang
Copy link
Member

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