Repository navigation
feat(desktop): add per-connection CA trust - #2964
jackie-cqz wants to merge 4 commits into
Conversation
hidb4ai
left a comment
There was a problem hiding this comment.
Reviewed a80ca8e. I found no confirmed correctness defect in the CA-input change. It reuses the existing per-connection trust contract and does not change database schema or IPC/API fields.
Merge validation remains incomplete: CI preflight was cancelled, desktop-validation was skipped, and the aggregate gates failed. Please obtain passing required checks on the current head and tested merge result, and complete the pending installed-Desktop HTTPS/CA flow before merging. My native TLS run was blocked by host GLib/WebKitGTK dependencies, so it does not independently confirm the reported real-Server acceptance. Renderer runs exceeded the normal 5-second timeout on this heavily loaded host; the two added CA cases passed with a diagnostic 30-second timeout, which is not a clean standard-suite result. The generator retry failure also reproduces with the base scripts.
This is a validation-gap comment, not a demonstrated code defect; withholding approval pending these checks.
knqiufan
left a comment
There was a problem hiding this comment.
Reviewed commit 9fd8b4e7.
The per-connection CA trust contract and security boundaries look solid; no merge-blocking issues found. Two small non-blocking polish items are noted inline (recommended before merge if convenient, otherwise fine to follow up):
- P3 (non-blocking): Check
discovery.errorandconnectionIdentity.errorin addition toliveness.errorfor TLS failures (Overview.tsx). - P3 (non-blocking): Bring invalid CA validation feedback into view after collapsing Advanced settings or scrolling up (
Overview.tsx).
| if (!active.report.compatibilityVerified) { | ||
| const failure = active.report.liveness.error; | ||
| throw failure?.code === "tls" | ||
| ? failure | ||
| : { code: "compatibility_unverified" }; | ||
| } |
There was a problem hiding this comment.
[P3] Surface TLS failures from discovery and connectionIdentity as well (non-blocking)
In native session.rs, compatibilityVerified is determined by discovery and connection_identity, whereas liveness is an independent HTTP request that does not gate compatibilityVerified. If discovery or connection_identity fails with code: "tls" while liveness succeeds (e.g. mixed edge TLS config or cert rotation), this branch discards the TLS error and asks the user to select a verified compatibility profile instead.
Required outcome: inspect [active.report.discovery?.error, active.report.connectionIdentity?.error, active.report.liveness.error] for a tls error before falling back to compatibility_unverified.
| </DialogHeader> | ||
| <DialogBody> | ||
| {error != null && ( | ||
| {error != null && !certificateError && ( |
There was a problem hiding this comment.
[P3] Keep invalid CA feedback visible in the dialog viewport on rejection (non-blocking)
When an invalid PEM is submitted after collapsing Advanced settings (or after scrolling back to the top of the dialog) at the default 1280×800 window size, setAdvancedOpen(true) expands the section and !certificateError suppresses the top PageFeedback, leaving the field error below the scrollable DialogBody viewport with zero visible height.
Required outcome: scroll the CA field/error into view and focus the CA input when invalid_certificate is returned (or retain a visible summary in view).
knqiufan
left a comment
There was a problem hiding this comment.
Reviewed commit 5a23f665. LGTM — both earlier feedback items are addressed, the per-connection CA trust boundary and error/retry flow look clean, and no blocking issues remain.
Which issue or RFC does this PR close?
Refs #2918.
Rationale for this change
Users on managed workstations may need to connect Desktop to a Server whose HTTPS certificate is signed by a private CA. They can use a CA provided by their administrator even when they cannot add it to the operating system's trust store.
What changes are included in this PR?
Are there any user-facing changes?
The new connection dialog labels the field in English and Chinese. An empty field uses the system trust store. Desktop continues to verify the hostname and uses a supplied CA only for that connection.
How was this change tested?
Local validation on macOS Apple Silicon at
a80ca8e7, based on upstream667f77e8.pnpm testpassed 88 renderer tests with mocked IPC and eight OpenAPI generator bootstrap tests using Node 24.14.1 and pnpm 11.13.1.oxlint ui scripts, Prettier,node scripts/generate.mjs --check,tsc --noEmit, andvite buildpassed.cargo +1.95.0 test --offline --locked --manifest-path desktop/src-tauri/Cargo.toml --test tlspassed with a loopback HTTPS fixture. It connected with the supplied CA and rejected a missing CA or a mismatched hostname.uv run --locked --no-sync python desktop/tests/real_server.pypassed all four modes using the nativeserver_probeand a locally built wheel. The private-CA HTTPS mode exercised a running SQLite-backed PowerContext Server over loopback with bearer authentication and a path prefix.uv run --locked prek run -aandgit diff --checkpassed.Installed Desktop UI validation remains pending.
AI usage statement
OpenAI Codex (GPT-6) implemented the change and regression tests, reviewed the diff, and ran the local checks.