Skip to content

fix(remote-input): preserve phone trust across restarts and IP changes - #1037

Merged
H-Chris233 merged 2 commits into
Open-Less:betafrom
zhou-zhichao:fix/remote-input-certificate-trust
Sep 9, 2026
Merged

fix(remote-input): preserve phone trust across restarts and IP changes#1037
H-Chris233 merged 2 commits into
Open-Less:betafrom
zhou-zhichao:fix/remote-input-certificate-trust

Conversation

@zhou-zhichao

@zhou-zhichao zhou-zhichao commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Remote input currently replaces the certificate trusted by the phone whenever a new LAN or virtual-adapter IP appears. For example, a virtual adapter changing from one private subnet to another invalidates Safari's earlier trust even when the actual Wi-Fi address stays the same. The phone setup panel is also hidden, and the downloadable root profile contains a non-CA server certificate.

This change persists a unique CA per computer and uses it to sign a separate server certificate. Restarts reuse the identity; new addresses or approaching leaf expiry reissue only the server certificate. The identity is saved as one atomic private bundle, and damaged, mismatched, or expiring CA material causes an explicit error rather than silently replacing the trust anchor. Tauri and Linux egui share this implementation and both serve public CA downloads as .cer and .mobileconfig files.

The phone pairing page now has a collapsed, accessible setup panel with separate iPhone and Android downloads. Desktop settings can copy the iPhone profile URL. All five locales explain installation and full trust, and profile identifiers include the CA fingerprint so different computers do not replace each other's profiles.

Older installations need a one-time certificate replacement. iOS still requires the user to install the profile and enable full trust; this is not silently automatable by a desktop app. The CA can issue certificates, so the UI and documentation describe its trust scope and removal. Existing v4 files remain available for rollback, and ordinary upgrades preserve the new identity in user configuration. See docs/remote-input-certificates.md for backup, recovery, and continuous-uptime limits.

Validation:

  • Seven Rust TLS regression tests pass, including real handshakes using only the downloaded CA, restart reuse, IP changes, renewal, damaged keys/signatures, persistence failure, and legacy-file preservation.
  • The 70-file frontend/contract suite and production frontend build pass.
  • Windows release build and final cargo check --locked pass (existing unrelated warnings remain).
  • Playwright checks at a 390 px mobile viewport pass in all five locales: setup expands, both download links are available, and there are no script errors or horizontal overflow.
  • Linux CI passed, including the shared TLS suite and Unix key-permission test. Native Linux GUI host and physical iPhone verification remain pending.
  • A targeted backport to the reporter's existing 1.3 installation was built and installed with a backup. Live HTTPS checks passed for localhost, loopback IP, and the LAN IP using a custom CA trust store with certificate and hostname verification enabled. The downloaded profile was parsed as a plist and matched the stored public CA; a verified WSS upgrade and PIN authentication also passed without starting a recording.

@H-Chris233
H-Chris233 marked this pull request as ready for review September 9, 2026 05:01

@H-Chris233 H-Chris233 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

首轮静态审核,基于 ebc0a74

优先推进这项修复,因为持久化 CA、单独签发服务器证书、损坏身份拒绝静默替换,直接针对重启和网络变化后的手机信任失效
已核对该提交关联的 CI,run 34120372206 返回 success;这不替代真机验收

合并前需要解决一个安全阻塞:首次安装根证书的引导只核对 IP 地址,然后跳过 TLS 警告并下载、完全信任 CA,缺少独立可信渠道的证书身份核验,详见行内意见

另请补充实体 iPhone 上的安装、完全信任、麦克风录音、桌面重启及 IP 变化验收,以及 Linux 原生 GUI host 的验收结果
本次没有本地运行完整项目或进行手机实测,不作合并批准

Comment on lines +13 to +24
2. Open the address in Safari. On the initial certificate warning, check the
address against the computer, then use **Show Details → Visit This Website**
to reach your own computer's setup page. This exception is only a bootstrap
step, not the persistent trust setup.
3. Expand **First-time setup: trust this computer** and choose **iPhone:
download profile**. Alternatively, open the copied `/cert.mobileconfig` link
directly in Safari.
4. Install the downloaded profile in **Settings → General → VPN & Device
Management**.
5. In **Settings → General → About → Certificate Trust Settings**, enable full
trust for **OpenLess Remote Input CA**. Return to Safari and reload the page.
6. Enter the pairing code and allow microphone access when Safari asks.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] 在完全信任根 CA 前加入独立的证书身份核验

这里要求用户跳过首次 TLS 警告,从该连接下载根证书并开启完全信任,之后才输入配对码
核对地址只能确认访问的 IP,不能确认响应方身份;在存在主动局域网中间人的情况下,对方可以在相同地址下替换页面和描述文件,让用户安装对方控制的根 CA

本 PR 从直接信任服务器证书改为信任具有签发能力的根 CA,因此不能仅依靠“地址一致”和从同一未认证页面取得的指纹来建立信任,后续 PIN 也无法追溯认证已经安装的 CA

请提供来自桌面端的可信证书传输,或在桌面端展示 CA 指纹并让用户通过独立可信的证书查看界面核对后再开启完全信任,同时为替换后的描述文件增加拒绝或明确警告的验证步骤
这是代码和引导流程的静态威胁分析,尚未做实体设备攻击复现

@Open-Less Open-Less deleted a comment from chatgpt-codex-connector Bot Sep 9, 2026
@H-Chris233
H-Chris233 merged commit 882fac6 into Open-Less:beta Sep 9, 2026
4 checks passed
H-Chris233 pushed a commit to MarkShawn2020/openless that referenced this pull request Sep 10, 2026
…/Mac 听写键、Open-Less#1020 腾讯云实时语音、Open-Less#1044 统一模型字段与异步保存隔离)并完成 2.0 UI 适配

冲突解决原则:2.0 重写的界面以本地为准,云端功能语义全部移植——
- ProviderForm 离开收敛接入 SettingsModal / ChannelList / LlmProtocolFields / CredentialField(关闭、切节、换供应商前冲掉防抖写入并等待在途写完成)
- 腾讯云三段式密钥 + 固定模型档分支移植进 2.0 ChannelCredentialFields;OAuth 静态模型走描述符
- Mac 听写键进入 ShortcutRecorder(allowMacDictationKey)并改用 refresh 拉新偏好
- 远程输入手机页新证书信任流程(持久本地 CA + 描述文件/CA 下载 + 复制链接),de/es/fr 补齐全套新文案
- 纯格式分歧文件取云端后 prettier 归一;双方新增内容(i18n、测试)两侧保留
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants