syncthing/syncthing-android

How to access HTTPS certificate ? - Not exported/imported

LBF38 opened this issue · 3 comments

Hi, I am searching my way to make the HTTPS certificate trusted on Android device.
To do so, I have tried to get access to the generated certificate from the storage but the device doesn't display the https-cert.pem and https-key.pem files.

Then, I have tried exporting the configuration from within the Syncthing Android app. However, only config.xml, key.pem and cert.pem are exported, not the HTTPS files for the GUI.

Therefore, is it possible to make them exported ? Could I import my own HTTPS certificate from the Import button in the app ?
Do you have an idea on how I could achieve this ?

Thank you in advance for your reply

bt90 commented

You'd need to generate your own CA certificate, create the web UI certificate from that and import the CA certificate into the truststore of Android as the last step.

As you already noted, the file access is the problem here. I think a PR with import/export functionality would be accepted, but I wouldn't hold by breath that someone else will implement this.

Thank you for your reply, I'll try to make a PR for the export/import feature when I have more time.
We agree on the solution, the only way is to import the custom HTTPS certificate via the import feature of the app, it is impossible from the file system.
Thx

There is a hack where you add Syncthing's own home folder in the /data partition which the app can access, and you sync it to another device. There, you could then replace the certificate file and sync it back to Android. This isn't the recommended method to it by any means though.