-
Notifications
You must be signed in to change notification settings - Fork 320
fix(remote-input): preserve phone trust across restarts and IP changes #1037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
H-Chris233
merged 2 commits into
Open-Less:beta
from
zhou-zhichao:fix/remote-input-certificate-trust
Sep 9, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # Remote input: one-time phone certificate setup | ||
|
|
||
| Remote input needs HTTPS for browser microphone access. OpenLess generates a | ||
| private certificate authority (CA) on each computer and a separate server | ||
| certificate covering that computer's LAN addresses. The phone installs the | ||
| public CA certificate. The CA private key stays in the computer's user data. | ||
|
|
||
| ## iPhone and iPad | ||
|
|
||
| 1. Enable remote input on the computer. Use the address shown in settings, on | ||
| the same network as the computer. Settings also has a **Copy iPhone | ||
| certificate link** button for each address. | ||
| 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. | ||
|
|
||
| Installing a profile and enabling full SSL trust are separate steps. Apple | ||
| requires the latter for profiles downloaded from a website; a desktop app | ||
| cannot silently approve it on a personal iPhone. See | ||
| [Apple's certificate trust instructions](https://support.apple.com/en-gb/102390). | ||
| This setup removes certificate warnings after trust is established; browser | ||
| microphone permissions and the pairing code remain separate controls. | ||
|
|
||
| Only install a CA from your own computer. A CA can issue certificates, so its | ||
| private key is sensitive. Remove the OpenLess profile from the phone when you | ||
| no longer use it. The certificate fingerprint in each profile identifier keeps | ||
| profiles for different computers from replacing one another. | ||
|
|
||
| ## Android | ||
|
|
||
| Download `/cert.cer` using the **Android: download CA** link. Install it through | ||
| the system's **Install a certificate → CA certificate** settings, then return | ||
| to the browser. Menu names and browser support for user-installed CAs vary by | ||
| device. The download contains only the public root certificate. | ||
|
|
||
| ## What OpenLess automates | ||
|
|
||
| - Creates and atomically persists a unique CA and server identity on first use. | ||
| - Reuses the same CA and server certificate after restarts and upgrades that | ||
| preserve application data. | ||
| - Reissues the server certificate when required LAN or virtual-adapter IPs | ||
| change, keeping the same CA and therefore the phone's trust. | ||
| - Renews the server certificate on service startup when less than 30 days | ||
| remain. Leaves are valid for at most 366 days including clock-skew allowance; | ||
| a continuously running service must restart before its leaf expires. | ||
| - Serves the public CA as a `.cer` file or iOS configuration profile on both | ||
| Tauri desktop and Linux egui hosts. The private keys are never downloaded. | ||
| - Refuses to start with a damaged, unreadable, mismatched, or expiring CA rather | ||
| than silently replacing the phone's trust anchor. | ||
|
|
||
| ## Upgrades, reinstalling, and recovery | ||
|
|
||
| Older releases used a directly self-signed leaf (`remote-cert-v4.der`) and | ||
| regenerated it whenever a newly observed IP was absent from a sidecar SAN list. | ||
| Even a virtual-adapter change could invalidate the certificate trusted by the | ||
| phone. Some releases also hid certificate setup and packaged the non-CA leaf | ||
| as a root profile. Upgrading from this format requires the one-time setup above. | ||
| Old files are left intact for rollback; they are not promoted to a CA. | ||
|
|
||
| Keep `remote-tls-identity-v1.json` with the application's user configuration | ||
| when backing up or reinstalling. On Windows it is in | ||
| `%APPDATA%\com.openless.app`; on Tauri macOS it is in the application's config | ||
| directory; on Linux egui it is in the host data directory's `remote-input` | ||
| subdirectory. This file contains private keys: do not publish it, send it to a | ||
| phone, or copy it to another computer. Unix files are owner-readable/writable | ||
| only; Windows files inherit the user's application-data ACL. | ||
|
|
||
| If this file is damaged, restore the computer's own backup. If it is lost, or | ||
| the CA expires (ten years), explicitly back up/remove the old identity while | ||
| OpenLess is stopped, restart, and install/trust the newly generated CA on each | ||
| phone. Deleting all application data necessarily loses the old trust identity. | ||
|
|
||
| ## Regression checks | ||
|
|
||
| ```sh | ||
| cargo test --manifest-path openless-all/app/src-tauri/backend-tests/Cargo.toml --test remote_tls | ||
| node openless-all/app/scripts/remote-input-audio-queue.test.mjs | ||
| ``` | ||
|
|
||
| The TLS tests exercise real rustls handshakes with only the downloaded CA as a | ||
| trust anchor, IP changes, restart reuse, renewal, corrupted keys, persistence | ||
| failure, migration, and separation between two computers. iOS installation and | ||
| microphone recording still require a physical-device smoke test. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 指纹并让用户通过独立可信的证书查看界面核对后再开启完全信任,同时为替换后的描述文件增加拒绝或明确警告的验证步骤
这是代码和引导流程的静态威胁分析,尚未做实体设备攻击复现