Trust user-installed CA certificates (self-hosted servers behind a private CA)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 50/100
研究方向
The trust configuration lives in app/src/main/res/xml/network_security_config.xml, whose base-config has no trust-anchors element. Check that the manifest points to this file, then read how the app builds its HTTPS client for server pairing. The maintainer has not chosen between the three options, so confirm the approach in the thread before editing. Done means a user-installed CA is accepted when pairing with a server behind a private CA.
由索引模型根據 Issue 內容生成。
描述
Problem
Pairing with an OpenCode server whose TLS certificate is signed by a private root CA
fails with -1202 serverCertificateUntrusted, although the root CA is installed on the
device (Settings → Security → Encryption & credentials → Trusted credentials → User).
Chrome on the same device opens the same URL without any certificate warning, so the
CA, the certificate chain and the SAN are all valid.
This is a common setup for self-hosted servers: a reverse proxy (nginx here) with a
certificate from a personal CA, reachable on the local network.
Environment
- App: OpenCode 0.8.6 (1015), installed from Google Play
- Server: nginx 1.27 terminating TLS in front of OpenCode, certificate signed by a private
root CA (RSA 2048, SHA-256, SAN matches the hostname, full chain served)
Error
URLError -1202 serverCertificateUntrusted · https://<host>:<port>
Phase: Pair
Message: Couldn't reach the OpenCode server
Cause
app/src/main/res/xml/network_security_config.xml only sets
<base-config cleartextTrafficPermitted="true" /> without <trust-anchors>.
On Android 7+ this means only system CAs are trusted; user-installed CAs are ignored.
Possible solutions
Any of these would solve it:
- Trust user CAs in the network security config (smallest change):
<base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> <certificates src="user" /> </trust-anchors> </base-config> - A toggle in Settings, e.g. "Trust user-installed certificates", off by default.
Since the network security config is static, this would need an OkHttp
X509TrustManagerthat combines the system store with the user CAs
(AndroidCAStore) when the toggle is on. - Importing a root CA in the app, e.g. per server under Edit Server, stored in
the app's own trust store. This works without installing the CA system-wide and
limits trust to that one server.
Option 1 matches what Chrome already does; options 2 and 3 give users more explicit
control.
- 主要語言
- Kotlin
- 星號
- 146
- 分支
- 35
- 平均合併
- 7 小時 41 分鐘
- 30 天內合併 PR
- 221
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
anomalyco/opencode-android 的其他 Issue
-
F-droid release未關閉
難度 3/5 1-2 天 新手友好度 55/100
anomalyco/opencode-android#345 ·
維護者通常 1 天內回覆
-
Crash: IllegalStateException in AppContext.getLiveValue可能已有人在做 @Tarquinen 於 1 天前認領。 未關閉crash crash-triaged
難度 3/5 半天 新手友好度 65/100
anomalyco/opencode-android#343 · 1 則留言 ·
維護者通常 1 天內回覆
-
crash crash-needs-human crash-triaged
難度 3/5 1-2 天 新手友好度 58/100
anomalyco/opencode-android#341 · 1 則留言 ·
維護者通常 1 天內回覆
-
crash crash-needs-human crash-triaged
難度 3/5 1-2 天 新手友好度 45/100
anomalyco/opencode-android#340 · 1 則留言 ·
維護者通常 1 天內回覆
-
Crash: OutOfMemoryError in LiveTransportKt$awaitResponse$2$2.onResponse可能已有人在做 @Tarquinen 於 3 天前認領。 未關閉crash crash-triaged
難度 2/5 1-3 小時 新手友好度 35/100
anomalyco/opencode-android#320 · 1 則留言 ·
維護者通常 1 天內回覆
查看 anomalyco/opencode-android 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 77/100
ScoopInstaller/Extras#19589 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 62/100
-
difficulty: beginner documentation help wanted networking
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 1/5 1 小時以內 新手友好度 72/100
維護者通常 1 天內回覆
-
feature request needs decision
難度 2/5 1-3 小時 新手友好度 83/100
tswistak/Battery-Monitor#207 ·
維護者通常 1 天內回覆