mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-04 23:37:31 +00:00
[PR #3404] [CLOSED] v3: Verify upstream TLS certificates when retrieving Manager notices #3270
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#3270
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/3404
Author: @StevenLi-phoenix
Created: 10/22/2026
Status: ❌ Closed
Base:
main← Head:fix/3302-notice-tls-verify📝 Commits (1)
e1606e3v3: Verify upstream TLS certificates when retrieving Manager notices📊 Changes
2 files changed (+229 additions, -46 deletions)
View changed files
📝
glob/manager_server.py(+50 -46)➕
tests/test_notice_tls.py(+179 -0)📄 Description
Refs #3302
This is the v3 (
main) half. The v4 legacy handler gets the same fix in #3405 againstmanager-v4, so this PR does not close the issue on its own.Problem
GET /manager/noticedownloads the GitHub wiki News page and shows its text and links in the Manager dialog. The handler built its connector withaiohttp.TCPConnector(verify_ssl=False). Certificate verification was therefore off for every user, whatever thebypass_sslsetting said. Anyone who can intercept the connection (a hostile network, a compromised proxy) can present any certificate for github.com and choose the notice text and links. The sanitizer from #3296 limits the markup, but it cannot authenticate the content.Also, a connection error made the handler raise, so the notice area showed aiohttp's "500 Internal Server Error" page text.
Fix
TCPConnector(verify_ssl=not manager_util.bypass_ssl). This is the expressionmanager_util.get_dataalready uses for the channel and list fetches. Verification is on by default.bypass_ssl = Trueinconfig.ini(the README's workaround forCERTIFICATE_VERIFY_FAILED) still turns it off.trust_env=Trueis unchanged, soHTTP(S)_PROXYandSSL_CERT_FILEkeep working.aiohttp.ClientErrorandasyncio.TimeoutErroraround the request. The handler logs a warning with the cause and returns the existingUnable to retrieve Noticeresponse (status 200), the same response it already gives for a non-200 reply.I used
verify_ssl=instead ofssl=on purpose. On aiohttp 3.8.x,TCPConnector(ssl=True)gives an unverified context:_get_ssl_contexttreats any value that is notNoneand not anSSLContextas "not verified". I checked this with the new test: withssl=not manager_util.bypass_ssl, the untrusted-certificate case fails on aiohttp 3.8.6 and passes on 3.14.verify_ssl=Trueverifies on every 3.x release and gives no deprecation warning. The warning from #2281 appears only whenbypass_sslis enabled, as it already does forget_data.Most of the diff is re-indentation for the new
try:. Withgit diff -wthe change is 5 lines.Behavior change
Users behind a TLS-intercepting proxy whose CA is not trusted now see
Unable to retrieve Noticeinstead of the notice. They get it back by trusting the proxy's CA (for example throughSSL_CERT_FILE) or by settingbypass_ssl = True. Manager's channel and list fetches throughget_dataalready behave this way.Scope
glob/share_3rdparty.pystill builds its connectors withTCPConnector(verify_ssl=False)(4 call sites). I left them alone on purpose, because #3302 covers notice retrieval only. They could be a follow-up.Tests
New
tests/test_notice_tls.py. Each case runs the realget_noticein a child process, extracted fromglob/manager_server.pywithastlike the other tests do. The child setsHTTPS_PROXYto a local CONNECT proxy. The proxy forwards the tunnel to a local HTTPS server that presents agithub.comcertificate from a throwaway CA, which the test creates with theopensslCLI. This is a man-in-the-middle with an untrusted certificate, and no traffic leaves 127.0.0.1. The cases:Unable to retrieve Notice, and the proxy sawCONNECT github.com:443SSL_CERT_FILE: returns the sanitized notice (formatting and link kept,<script>removed, version footer added)bypass_ssl = True: returns the noticeUnable to retrieve Noticeinstead of raisingA child process is needed because recent aiohttp versions build the verified SSL context at import time. The class is skipped if there is no
opensslCLI.Before the fix (base
glob/loaded throughMANAGER_GLOB_DIR):After the fix:
Other checks:
opensslthat ships with macOS as well as OpenSSL.tests/e2e, which needs a prepared ComfyUI root (E2E_COMFYUI_ROOT).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.