Skip to content

fix(desktop): trust system certificates#25837

Merged
Hona merged 4 commits intoanomalyco:devfrom
Hona:fix/desktop-system-ca
May 5, 2026
Merged

fix(desktop): trust system certificates#25837
Hona merged 4 commits intoanomalyco:devfrom
Hona:fix/desktop-system-ca

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented May 5, 2026

Summary

  • Trust OS-installed certificate authorities in the desktop main process before starting the embedded Node server.
  • Keeps corporate TLS interception certificates trusted for server-side fetches used during config bootstrap.

Verification

  • bun typecheck from packages/desktop
  • pre-push bun turbo typecheck
  • local repro produced the reported 500/log shape before this change: TypeError: fetch failed with self-signed certificate

@Hona Hona requested a review from adamdotdevin as a code owner May 5, 2026 08:19
Copilot AI review requested due to automatic review settings May 5, 2026 08:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the desktop main process so the embedded opencode Node server inherits the OS certificate trust store before startup, which helps server-side bootstrap fetches succeed in environments with corporate/intercepting CAs.

Changes:

  • Added a local node:tls type augmentation for CA management APIs used by the Electron main process.
  • Added startup logic in the desktop main entrypoint to merge Node’s default CA set with the system CA set.
  • Runs the certificate setup before normal app/server initialization begins.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
packages/desktop/src/main/node-tls.d.ts Adds typings for the TLS CA APIs used by the new startup hook.
packages/desktop/src/main/index.ts Applies system CA certificates early in desktop main-process startup before embedded server initialization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hona Hona merged commit b8f8f5d into anomalyco:dev May 5, 2026
8 of 9 checks passed
@JtMotoX
Copy link
Copy Markdown

JtMotoX commented May 6, 2026

Thanks @Hona. I have confirmed this fixed the Desktop app. Any chance you could do the same for the Web app?

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.

3 participants