mueslo / openwrt_hass_devicetracker

Simple OpenWRT package which forwards device connection changes to a HomeAssistant instance
GNU General Public License v3.0
92 stars 31 forks source link

HTTPS #11

Closed witten closed 5 years ago

witten commented 5 years ago

As far as I can tell, the current functions.sh post() function unconditionally hits the $hass_host with unencrypted HTTP, because the code does not specify the protocol. It would be great to optionally support encrypted HTTPS as well, because HTTPS is a valid configuration for even local Home Assistant installations, and certainly for remote-accessible ones.

One idea is for "HTTP versus HTTPS" to just be a openwrt_hass_devicetracker configuration option, and then it could be passed to curl accordingly. However, a complicating aspect is that if the Home Assistant instance is using a self-signed cert, then curl may need a --cacert parameter with a valid Certificate Authority cert file, or at worst, --insecure.

mueslo commented 5 years ago

Does setting your host configuration variable to begin with https:// not work?

witten commented 5 years ago

Good idea. That works! If this is the desired solution, then maybe this could just be changed into a documentation ticket, as others may also not be aware that a protocol can be included with the host option. Thanks.

mueslo commented 5 years ago

I've added it to the readme for now

witten commented 5 years ago

Thanks!

xorbital commented 4 years ago

Sadly, self-signed certificates result in an error. Adding -k after "curl" in functions.sh works, so maybe a config setting would be a good solution?