MerginMaps / MerginMaps/mobile

SSL connection fails with user-installed CA certificates on Android

Open
#4,286 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement permissions security
Dominant language
C++
Stars
388
Forks
87
Avg merge
2d 7h
Merged PRs (30d)
20

Description

Description

Mergin Maps application fails to establish a secure SSL/TLS connection on Android 7+ devices when the server certificate chains to a newer Root CA (Sectigo, issued 2021) not yet included in the Android system CA store on some devices. The connection fails even when the Root CA certificate is successfully deployed via Microsoft Intune MDM.

Root Cause Analysis:

Starting with Android 7.0 (Nougat), Android introduced significant changes to how apps handle certificate trust. Apps targeting API Level 24+ no longer trust user-installed or MDM-deployed certificates by default - they only trust pre-installed system CAs.

This means that even when an administrator successfully deploys a trusted Root CA certificate via Intune (or any other MDM), the Mergin Maps application ignores it because the app is not configured to trust certificates from the "user" certificate store.

Technical Details:


Environment

  • Production

Application (+ app version, build, operating system)

  • App: Mergin Maps
  • Version: Latest
  • OS: Android
  • OS Version: Android 7.0+ (API Level 24+)
  • Device: Zebra TC26 (and other Android Enterprise managed devices)

Actual results

  • Application throws a connection error

Expected results

  • Application should trust the MDM-deployed Root CA certificate
  • SSL/TLS connection should be established successfully
  • API communication and data sync should work normally

Proposed Solution

The application needs to include a network_security_config.xml file that explicitly trusts user-installed certificates.

We did this with our in house app:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <base-config cleartextTrafficPermitted="true">
    <trust-anchors>
      <certificates src="system" />
      <certificates src="user" />
    </trust-anchors>
  </base-config>
  <domain-config>
    <domain includeSubdomains="true">*</domain>
    <trust-anchors>
      <certificates src="user"/>
      <certificates src="system"/>
    </trust-anchors>
  </domain-config>
</network-security-config>
<application android:label="OurApp" android:allowBackup="false" android:fullBackupContent="false" android:networkSecurityConfig="@xml/network_security_config"></application>

Related Documentation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Android Network Security Configuration documentation and the proposed network_security_config.xml, then locate the application manifest entry where android:networkSecurityConfig can be added. Confirm the configuration preserves system trust while allowing user-installed certificates, and verify API communication and data sync with an MDM-deployed CA on Android 7+.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.