The issue is that when I open the Home Assistant app on Android, I get “Unable to connect to Home Assistant.” I have to press “Retry now” twice before the app finally connects and loads my Home Assistant dashboard.
Does the Home Assistant Android app fully support mTLS / client certificates?
If it does, why does the connection fail on the first attempt and only work after pressing “Retry now” twice?
Could this be related to how the Android app handles client certificates, TLS connections, or connection retries?
I’ve been experiencing this as well for a while, at least a year I think. My setup is almost completely different from yours other than the Android app and mTLS.
I have Cloudflare handling the mTLS in front of a cloudflared tunnel into my home network. I have to click retry several times before it decides to work sometimes.
Given the difference in our setups, I think that’s a pretty good indicator that the problem lies either with the HA app itself, or with Android.
FYI, I just have to accept the certificate every time I open the browser, but it works immediately after that. I don’t have to click the “Retry” button.
So, I understand that the issue is coming from the app itself.
I did a cursory search and didn’t see it as an issue on Github, so creating that would be a good idea after verifying no one has raised the issue already.
If you’re inclined to, trying to reproduce the behavior while monitoring the Android logs (logcat) might be a good first step for debugging and determining what the root cause is. From there one could theoretically make the fix and then issue a pull request!