Johboh / hassalarm

Android app for integration with Hass.io as a sensor for the next scheduled alarm on the device
MIT License
62 stars 6 forks source link

Unable to connect with SSL self signed certificate #20

Closed kgd192 closed 3 years ago

kgd192 commented 3 years ago

Screenshot_20201217-074627~2

The following issue is occuring when trying to connect to my HA Instance via SSL using self signed certificates. Both the Root and Intermediate CA are installed in Android and Chrome showes the connections certificates as valid. Is there any remediation for that issue?

Johboh commented 3 years ago

Hey! A bit of googling hints that this might be issues with the self signed certificates. Do you see any logs on home assistant side? I'm using the app with https and certs from letsencrypt (using traefik reverse proxy)

Johboh commented 3 years ago

@Fahrenheit92 https://github.com/Johboh/hassalarm/issues/17

kgd192 commented 3 years ago

I will check the logs, just fyi the Homeassistant Android app started working properly with the same SSL Connection when I imported the Root and Intermediate CAs into Android so the actual Certificate could be verified as valid

EDIT: Nothing suspicious in the Server Logs. For me it looks like hassalarm is not taking user imported CAs/Certificates into account when validating the connection?!

Johboh commented 3 years ago

Hmm, I will take a look in the coming days!

kgd192 commented 3 years ago

Hmm, I will take a look in the coming days!

Thank you very much in advance, I will have a glance over the source code myself, unfortunately i am not very familiar with the Android API

Johboh commented 3 years ago

@Fahrenheit92 Pushed a new version (1.17) just now, please test with that one.

kgd192 commented 3 years ago

@Johboh SSL Error seems to be fixed. I am now stuck with an Error 400, but I will investigate a bit this seems to be an error on my server side. Will keep you posted

Tanks

kgd192 commented 3 years ago

EDIT: Only happens in "Test Connection" when no actual Alarm is set! Actual App Functionality is NOT affected, works as advertised ;)

@Johboh So it seems like something is wrong with the request send, this is whats send in "input_datetime"-mode

Screenshot_20201218-171536

and this is the request send with "legacy/sensor"-mode selected

Screenshot_20201218-171543

Johboh commented 3 years ago

@Fahrenheit92 yes, looks like it fails when there is no next alarm set. I will fix that. In the meantime, try setting a next alarm and try again.

kgd192 commented 3 years ago

@Fahrenheit92 yes, looks like it fails when there is no next alarm set. I will fix that. In the meantime, try setting a next alarm and try again.

Sorry, already edited :D Yes this is the issue, furthermore, when the alarm is switched off the input_datetime on HA is not cleared, i.e. remains the last published.

Johboh commented 3 years ago

Yes, its because the request fails. Will fix :)

Johboh commented 3 years ago

@Fahrenheit92 I pushed an 1.18 version now, will take some hours to propagate. Works locally here for me, let me know how it works for you.

kgd192 commented 3 years ago

@Johboh Works like a charm Thanks for the quick support!

Johboh commented 3 years ago

Great!