Nitwel / Immersive-Home

Mixed reality experience for interacting with your smart home in a new dimension.
Apache License 2.0
454 stars 18 forks source link

Enable (unsafe) connecting to secure sockets (wss://) #159

Closed goatchurchprime closed 3 months ago

goatchurchprime commented 3 months ago

On line here: https://github.com/Nitwel/Immersive-Home/blob/main/app/lib/home_apis/hass_ws/connection.gd#L59

var error = socket.connect_to_url(url + "/api/websocket")

should be:

var error = socket.connect_to_url(url + "/api/websocket", TLSOptions.client_unsafe())

to enable connecting to "wss://" type connections.

I am told that it will be impossible safe connections with a LAN based HA as the certificate validation can only be done against a DNS name (not an IP number), and probably not against mDNS (homeassistant.local) type names either. Perhaps it's possible with a HA installed in the cloud.

Also, it would be much kinder if your default connection error was not "Invalid URL", (line 107) as this is unhelpfully misleading when the URL is perfectly fine (no hidden spaces etc), and there's something else wrong.