Skip to content
imTigger edited this page Oct 18, 2019 · 9 revisions

HTTPS/WSS Support

Some browser does not allow webpage with secure context (i.e. HTTPS) to connect non-secured WebSocket server.

Either of below methods required to workaround this:

Allow non-secure WebSocket server from HTTPS website (Not recommended)

Warning: These setting can open a security hole, use on development environment only

Firefox: Go to about:config, set network.websocket.allowInsecureFromHTTPS to true

Chrome: Add --allow-running-insecure-content to launching argument

Enable WebSocket Secure (WSS) with self-signed certificate

Available since Version 0.9, WHB have built-in ability to generate self-signed certificate!

Set tls.enabled to true, tls.selfSigned to true in config.json and relaunch the application.

Upon start, application should automatically generate a self-signed certificate

and start listening on wss://127.0.0.1:12212 with secured connection.

On first setup, you must go to https://127.0.0.1:12212 to accept that self-signed certificate.

(You should see a "404 WebSocket Upgrade Failure", that's normal)

After change, point url to wss://127.0.0.1:12212 instead of ws://127.0.0.1:12212

Enable WebSocket Secure (WSS) with user-provided certificate

Available since Version 0.9

Copy your certificate and private key to tls directory.

Set tls.enabled to true, tls.selfSigned to false, tls.cert and tls.key in config.json and relaunch the application.

Upon start, application should pickup your certificate and start listening on wss://127.0.0.1:12212 with secured connection.

After change, point url to wss://127.0.0.1:12212 instead of ws://127.0.0.1:12212

But wait, it's normally impossible to obtain valid certificates signed for 127.0.0.1.

Getting valid certificates would be another long story

Clone this wiki locally