-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to refresh entities #17
Comments
hi |
I've had the same problem as author (Unknown error -300). I did a little bit of troubleshooting and it turns out it was caused by my self signed certificate even though cert is installed and working in my android (Using Caddy as reverse proxy with self signed cert). When I exposed HA instance to internet (using duckdns with LetsEncrypt certificate) everything started to work. @hatl is there a way to make self signed cert working? I would prefer using VPN to access my HA instance rather than exposing it to the internet |
I can now also confirm that. When I use my self signed certificate, that I imported to my android device the widget refuses to refresh the entities with error code 300. It would be really great if self signed certificates would also work, because I don't want to expose my home assistant to the internet just to use the widget. |
I'm using caddy to get the certificates and home assistant is only available in the LAN and the following Caddyfile:
|
I don't understand this resolution...I get a similar error using an internal-only TLS certificate. Is there any way to allow more general TLS connectivity? The connectivity works totally fine from my Android device. |
@hatl : agree with @F13 . Just received my Venu 3 and wanted to your application but I'm getting the same error with a self-signed certificate. The API token works fine. I'm using the buit-in Nginx module.
BTW, a couple of comments regarding the logging process:
I did create a scene and triggered it (using my laptop) after opening the widget (and click on
This is the process I followed and I get a blackscreen. and FYI, I've added my self-signed certificate to my phone and the application (Companion) works well, as well as with Chrome. Thanks! |
the Garmin API doesn't allow the usage of self-signed certificates - for good reasons (security) importing them on the phone only makes them available on the phone so having an "official" SSL certificate is currently a must-have |
thanks for the prompt response @hatl ! |
That is very unfortunate. There's no inherent security risk to allowing the user to trust certificates outside of the "globally trusted" certificate issuers; in fact, for advanced users, it can be just the opposite. In order to get an "official" SSL certificate, I would have to setup DNS resolution for a globally accessible domain that points to my infrastructure. I understand most people are fine with this, but I disagree with device manufacturers' insistence in locking down SSL trust chains :) Is there any option in the Garmin API to simply skip certificate validation? Exposing that option to users would allow the user to use whatever certificate they wanted. |
Does the watch communicate directly with the services over HTTPS? It doesn't go through your connected mobile (Android/Apple)? |
Unfortunately not - the documentation of the corresponding method (makeWebRequest) can be found here: https://developer.garmin.com/connect-iq/api-docs/Toybox/Communications.html#makeWebRequest-instance_function
yes.
Its being "tunneled" trhough the bluetooth connection to the phone, but the actual connection is established between the Garmin device and Home Assistant. This is why adding the SSL certificates on the phone doesn't help. |
@F13 agree for the security, and yeah, it's unfortunate. As a workaround, it could be possible to retrieve a genuine LE certificate and use a local DNS to fake the IP address. EDIT: someone apparently did it by installing a root certificate on his iPhone: https://forums.garmin.com/developer/connect-iq/f/discussion/291012/makewebrequest-for-internal-networks |
My CA cert is fully installed and trusted on my Android already. It doesn't appear that Garmin Connect uses the Android certificates. |
I finally managed to find a way using the following steps:
It's probably possible to bypass the reverse to point to HA directly (Nginx) but the certificate provided by LE doesn't seem to be recognize by Nginx (most probably a format issue) EDIT: I found a way to add another nginx conf file to handle the request for the new domain following this guide https://community.home-assistant.io/t/using-nginx-ssl-proxy-to-forward-different-domains-to-different-services/347342/4 Anyway, thanks for your app @hatl ! |
Hi,
I have managed to connect to my HA using a long-lived access token.
My configuration in Connect IQ HA settings is:
Scenes:
Group: group.garmin
My config in HA helpers is as below:
When I do a "Refresh entities" I get on the watch:
It also seems to trigger this on HA´s log:
2023-03-18 11:25:43.732 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Any ideas?
The text was updated successfully, but these errors were encountered: