webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and HTML5 in the frontend, all in a lightweight portable lib.
https://webui.me
MIT License
2.36k stars 144 forks source link

OpenSSL doesn't work in Firefox and Safari #341

Closed Juff-Ma closed 1 month ago

Juff-Ma commented 3 months ago

All non-chromium based Browsers we tested will not connect to a secure websocket when using a self-signed certificate. using a non-self-signed certificate wouldn't be practical with webui. The problem seems to be that every non-chromium based browser doesn't accept wss connections to a diferent port than the website if the certificate of the websocket is self-signed.

Would it be possible to run the websocket on the same port as the built-in webserver? While most users will use a Chromium based browser, some will not and Safari and Firefox together do make up a significant portion of users.

This seems to be a known issue, at least for firefox.

Edit: An additional complication seems to be that WebUI will consider the website inaccessible if this occurs and show the "Access Denied, already running in another browser" when reloading the page, this will be shown until a successfull websocket connection is made from another browser

zlElo commented 3 months ago

+1

AlbertShown commented 3 months ago

Good point, but unfortunately, Civetweb does not support running multiple servers on the same port out-of-the-box. Each server instance typically binds to a specific port, and Civetweb does not provide built-in functionality for sharing a single port between multiple servers.

Here webui start the web server: Line 6770 Here webui start the WS server: Line 6809

This issue is related to how browser deals with TLS, I mean it's not really a webui issue. Running a public web server with a self signed certificate will get the exact same error/warning.

Juff-Ma commented 3 months ago

Are you sure? I'm not an expert on civetweb but according to this issue (particularly the last comment) civetweb does support (and reccomend) it since 2015. Of yourse 2015 was 9 years ago however i don't know why they would remove support for something like this.

In this issue too it seems to be possible and while here it didn't work finally this doesn't seem to be related to civetweb directly.

AlbertShown commented 3 months ago

True, it seems civetweb supports it... This will be a very good feature to add to webui.

AlbertShown commented 3 months ago

image

AlbertShown commented 3 months ago

image

ttytm commented 1 month ago

Isn't ChatGPT just a spellchecker :thinking:?