flic-hub-home-assistant-module icon indicating copy to clipboard operation
flic-hub-home-assistant-module copied to clipboard

Enable Self-signed TLS Support

Open BrookeDot opened this issue 1 year ago • 1 comments

I recently installed a self-signed certificate to my docker install of Home Assistant. This broke the Flick Hub connection. I was hoping I could just add verify_tls : false to the API endpoint but think it is actually Flic that is denying the request, not home assistant.

I updated the exports.SERVER_HOST to use https and then was successful in adding options.verify_ssl = false; on line 89 of ha.js: https://github.com/blunan/flic-hub-home-assistant-module/blob/main/flic_hub_module/ha.js#L88

But I am still getting the Error: "TlsFailure" response. Any thoughts?

Request: { 
"method":"POST",
"url":"https://192.168.x.xxx:8123/api/states/binary_sensor.flic_XXXX_connectivity",
"content":"{
    \ "state\":\"on\",
    \"attributes\":
            {\"device_class\":\"connectivity\",
            \"icon\":\"mdi:bluetooth\",
           \"friendly_name\":\"My Flic Connectivity\"
      }
 }",
"headers":{"Authorization":"Bearer XXX",
"Content-Type":"application/json"},
"verify_ssl":false}

Error: "TlsFailure"

If there is a simple solution I'd be happy to open a PR so this could be added to the config as an option.

BrookeDot avatar Feb 16 '24 06:02 BrookeDot

I now see that the TlsFailure method is indeed coming from the FlicSDK's HTTP Class 🤔 https://hubsdk.flic.io/static/documentation/#39_http_class

I asked in the Flic forms to see if anyone there has any ideas as I'm not seeing an easy way to disable TLS on the Flic end: https://community.flic.io/topic/18418/allow-insecure-tls-with-the-http-module

BrookeDot avatar Feb 16 '24 07:02 BrookeDot