Krita ai plugin can't connect with SSL URL, it showed handshake issue
i enabled the comfyUI SSL connection, and then i found that i can't use https://127.0.0.1:8188 in krita ai plugin, i want to know if krita ai plugin can support SSL connection or not? or we can just use http only? please help, thanks a lot
SSL (https URL) generally works, it's required to run it with cloud providers. I haven't tried ComfyUI built-in though, it might be an issue with the server implementation, or the certificate.
Also note that when you use https, the plugin expects the WebSocket connection to also use SSL (ie. wss instead of ws).
Hello Acly, i have tried many times, and search though lots of website, but no luck and no information on how to fix this issue, can you try to use comfyUI built in and do a SSL connection with krita? i have no idea what i can do next, please help, thanks a lot!
Where is your TLS certificate from? Are you using a self-signed certificate? If yes that's likely the problem.
no, i'm using a cert from santigo, a commercial valid cert, i just put the key.pem and cert.pem under the comfyUI folder, and then added the -tls attributes like this, \python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --listen --tls-keyfile key.pem --tls-certfile cert.pem
Hello Acly, any updates on it? please help, thanks a lot!
I tried it with a self-signed cert, using the command you posted.
It gives the following SSL errors:
WARNING SSL error: The host name did not match any of the valid hosts for this certificate [22]
WARNING SSL error: The certificate is self-signed, and untrusted [9]
which is fair enough. I then get the SSL Handshake failed.
If I ignore the SSL errors, I get the same issue when establishing the websocket connection. If I ignore those errors too, it works.
So it should work with a valid certificate and matching hostname. If your cert is for www.example.com and you're trying it on localhost, it will fail.
See my commit above for the code changes to add more specific error logging.
Hello Acly, after your prove above, i tried it myself, and i figured out what was happened, i used a valid cert in comfyUI, but i did not put in a domain name inside the krita, just use the ip address, and it showed the handshake error, and i set a dns name in local host file, then use the domain name in krita to connect again, the connection is successful, many thanks for your help. thanks a lot!
by the way, i found that for windows krita plugin to connect https is ok now, but for Mac, it still show the error: SSL handshake failed, is it any difference for them?
yea some extra hoops to jump through: https://github.com/Acly/krita-ai-diffusion/issues/74#issuecomment-1819993842 possibly this can be done inside the plugin somehow, but I don't have a Mac
hi Acly, thanks your effort, i have tried myself and confirmed that for http, mac can connect without any issues, but with https, it showed the handshake error, i have go through #74 , i saw someone can fix the issue, but don't know how the below thing work... any idea? $ CERT_PATH=$(python3 -m certifi) $ export SSL_CERT_FILE=${CERT_PATH} $ export REQUESTS_CA_BUNDLE=${CERT_PATH} $ cd /Applications/krita.app/Contents/MacOS/ $ ./krita
I think you enter those commands in terminal.
But I don't know how to properly add it to the plugin code, or rather I can't test it. Need someone with Mac to do that.
i have mac, may be if you have any idea on it, i can help to test, just let me know