Is there a way to permanently remember a client certificate in the Android companion app?
I've recently implemented client certs for my HA setup (through an exsternal nginx reverse proxy). It's working great, including with the Android app. However, regularly (after a day or so) the companion app stops reporting back to the HA server, and I have to open it on the device and re-select the client cert - then it works again, for a while.
After some googling, it seems that Android doesn't support permanently selecting a client cert (webview / Chrome functionality?). According to the HA docs, the app uses the native Android cert store. So, could this be solved by uploading/storing a client cert directly in the HA companion app? Or what other solution(s) exist for this?
Hi @vekexasia
As mentioned, the client cert basically works. When I start the HA companion app, I have to select the client cert ("Choose certificate" - I assume a prompt from Android since the same prompt appears for other client certs eg. in a browser) and it connects fine. The app also reports sensor data back to the server. Re-opening the app doesn't require selecting the cert again, except after a while (I'd say within 24h) the app stops reporting back, and I have to re-select the same cert through the same prompt when I open the app. Rinse and repeat.
So, my best guess is that the HA app doesn't store the client cert selection, and neither does Android. As long as the session is valid (time expiration?) the connection works. But as soon as the cert has to be re-validated, it has to be manually selected again.
I have no experience with Android coding, so I haven't dug into any code.
I'm using a Motorola phone with Android 16.
Same behaviour: Chrome shows the same "Choose certificate" selector (as does Firefox). After closing Chrome, I have to re-select the cert again, as well.
In my case, an Apache reverse proxy is handling the client certs.