Skip to content

Support user-installed certificate authorities for self-hosted servers #140

Closed

Description

@lewxdev

Description

The ZenNotes Android app fails to connect to a self-hosted server using HTTPS with a certificate issued by a private CA (step-ca).

The server is reachable through a browser, but the native Android app reports:

java.security.cert.CertPathValidatorException:
Trust anchor for certification path not found.

This appears to be related to Android's default behavior of not trusting user-installed certificate authorities in apps targeting modern Android versions.

Expected behavior

ZenNotes should be able to connect to self-hosted HTTPS servers whose certificate authorities are explicitly trusted by the user through Android's certificate settings.

Suggested solution

Android supports opting into user-installed CAs through a Network Security Configuration.

For example, res/xml/network_security_config.xml:

<network-security-config>
    <base-config>
        <trust-anchors>
            <certificates src="system" />
            <certificates src="user" />
        </trust-anchors>
    </base-config>
</network-security-config>

Referenced from AndroidManifest.xml:

android:networkSecurityConfig="@xml/network_security_config"

This would preserve TLS certificate verification while allowing self-hosted deployments using private PKI, without requiring users to modify their Android system or rebuild the APK.

A more restrictive, opt-in approach would also be worth considering if trusting user-installed CAs globally is undesirable.

Related

Both issues affect users connecting to self-hosted ZenNotes servers secured with privately trusted certificate authorities.

Activity

  1. lewxdev commented on Oct 28, 2026

    @lewxdev
    ContributorAuthor

    Confirmed working on my Pixel 8 running Android 17 (CP3A.261005.005), using the patched build from PR #141.

    Tested:

    • More → Vaults → Add Remote Vault → zennotes.app.home.arpa → authentication token.
    • Connected successfully with no error.
    • Created a note on Android and confirmed it synced to desktop.

    This verifies remote-vault connection and Android-to-desktop note sync against my private-CA server. Attachment transfers, desktop-to-Android sync, and negative TLS cases (untrusted CA, expired certificate, hostname mismatch) were not tested in this check.

  2. lewxdev commented on Oct 29, 2026

    @lewxdev
    ContributorAuthor

    fixed in 1.1.50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions