# x509: certificate has expired or is not yet valid

**URL:** https://forum.syncthing.net/t/x509-certificate-has-expired-or-is-not-yet-valid/17617
**Category:** Android
**Created:** [November 16, 2021, 4:37pm UTC](https://forum.syncthing.net/t/x509-certificate-has-expired-or-is-not-yet-valid/17617 "2021-11-16T16:37:47Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [November 18, 2021, 5:42am UTC](https://forum.syncthing.net/t/x509-certificate-has-expired-or-is-not-yet-valid/17617/7 "2021-11-18T05:42:05Z")

</div>

I have fixed the problem. The thing is that the certificate has to be installed in the system storage, as otherwise Syncthing seems to completely ignore it. Of course, in order to do so, you need to have root access, so if your Android device isn’t rooted, you’re probably out of luck (unless you’ve got a custom recovery with `/system` access).

The detailed steps are as follows.

1. Download [https://letsencrypt.org/certs/isrgrootx1.pem.txt](https://letsencrypt.org/certs/isrgrootx1.pem.txt).

2. Run `openssl x509 -inform PEM -subject_hash -in isrgrootx1.pem.txt` (in Windows, you can use `openssl.exe` from [MSYS2](https://msys2.org)).

3. Look for the subject of the certificate in the command output. It was `4042bcee` in my case.

4. Rename the file from `isrgrootx1.pem.txt` to `4042bcee.0`.

5. Copy the file to the Android device, e.g. with `adb push 4042bcee.0 /sdcard/`.

6. Open the shell, e.g. with `adb shell` (or you can use a terminal emulator on the device itself).

7. Switch to root, mount the `/system` partition as writeable, copy the certificate to the system storage, fix the permissions, then remount the partition as read-only.

8. Restart Syncthing, which should now be able to connect to relays.

The instructions are based on the @Catfriend1’s link and also on a few other sources I’ve managed to find in the Internet. I’ve tested them with success on the two devices mentioned in this thread.

---

_[View the full topic](https://forum.syncthing.net/t/x509-certificate-has-expired-or-is-not-yet-valid/17617)._
