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

Error using Webinterface without HTTPS/TLS: crypto.subtle is undefined #8

Closed
zierf opened this issue Nov 19, 2023 · 2 comments
Closed

Comments

@zierf
Copy link

zierf commented Nov 19, 2023

Adding a Highway Node to comfy workflow prevents new images from being added to the queue if the webinterface was not opened in a secure context (HTTPS).

Reproducable using commit #d9d8702 (2023-11-19) for ComfyUI and commit #b7d64ce (2023-11-16) for this extension.


Following error will be reported under Settings ➜ View Logs:

TypeError
can't access property "digest", crypto.subtle is undefined
randomSHA256@http://[HOSTNAME]:8188/extensions/ComfyUI-0246/js/nodes.js:41:21

There is no output in command line.


According to MDN: SubtleCrypto, the browser interface crypto.subtle is not usable from a website without TLS.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

So I tested this again using the webinterface behind a reverse proxy with TLS encryption, which prevented the error from being thrown.


For TLS support I found this related open Issue #1105 and Pull Request #1481 (not provided in aforementioned commit) in ComfyUI repository.

Even if these could solve the current problem, I don't think enabling TLS should be a requirement, especially if ComfyUI isn't exposed to the outside world. Maybe the usage of crypto.subtle for generating SHA-256 hashes should be replaced by a library. However, I'm not sure which one would be best for this. It's a shame that the Crypto API cannot be used for HTTP pages, even for such small use cases.

@Trung0246
Copy link
Owner

I guess I totally forgot about the crypto.subtle api thing only available for https. Woops. Guess I'll pick something else.

@Trung0246
Copy link
Owner

Just pushed update.

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

No branches or pull requests

2 participants