feat(tauri): support self-signed remote HTTPS via server-backed proxy#333
Conversation
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
I reviewed the latest PR state as a gatekeeper pass for regressions and implementation quality. I interpreted the request as: review the current diff against Findings
Validation Notes
-- |
|
@pascalandr - The packages/server already generates and manages the certificate, why not we use that instead of trying to create / manage the certificate in Tauri separately? |
|
Can Tauri use the same certificate thats generated by packages/server ? |
|
I interpreted the question as: can the Tauri localhost proxy reuse the TLS material already generated by Short answer: yes, technically it can, but not as a drop-in reuse of the current What I found:
Why it is not a straight swap:
My gatekeeper take:
So: yes, Tauri can use the same certificate chain generated by -- |
|
Addressed in
Validation:
About the CA-signed cert that would be a refactor of the local TLS architecture, not the goal of this PR, which is just to give Tauri a user-facing self-signed remote flow equivalent to Electron with the platform-specific mechanism each runtime actually supports. |
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
I reviewed the latest PR state as a fresh gatekeeper pass after Findings
What I Re-checked
Validation Notes
-- |
|
I removed the HTTP fallback for HTTPS remotes, so we now fail fast with a user-facing error instead of silently breaking secure-cookie auth. I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
I reviewed the latest PR state again. I interpreted the request as: gatekeep the current branch tip against Findings
Re-check Notes
Validation Notes
-- |
|
Sorry I mixed up some branches I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
I reviewed the latest PR state again. I interpreted the request as: gatekeep the current branch tip against No findings. What I re-checked:
Validation notes:
Residual risk:
-- |
We shouldn't duplicate the certificate management when we already have in server. We should always use that and if not present, should error out rather than creating one in here too. |
|
I agree that reusing the |
|
@pascalandr - It won't be wise to take on a PR with known technical debt. Also just to understand if this is currently expected to only work in Windows and Linux or macOS too? |
|
Ok I will rework this to reuse the packages/server's managed certificates. |
|
@shantur sorry I was skeptical about this refactor at first, but it does work on Windows!! |
|
How does it look now? |
|
I re-checked the latest PR state against Findings
Current Assessment
Validation Notes
So: better than before, but not yet aligned with the latest requested certificate-management approach. -- |
|
@shantur sorry I forgot to update the PR How does it look now? |
|
I re-checked the latest PR state against No findings. What changed materially since the previous pass:
Validation notes:
Residual risk:
-- |
|
@pascalandr - Can we discuss this on Discord please, I think it can be made even simpler |
Route remote windows through a trusted local HTTPS proxy so WebView2 accepts secure cookies with self-signed servers. Preserve remote base paths, rewrite origin headers for proxied requests, and keep the certificate helper buildable outside Windows.
Use WebKitGTK TLS exceptions for remote windows so Linux no longer depends on system CA installation or sudo-managed trust stores.
Keep proxied requests under the configured remote base path and fail fast when the local HTTPS proxy certificate cannot be trusted, instead of starting a broken HTTPS proxy.
This reverts commit ec3b418.
Load server-managed TLS certificates (server-cert.pem, server-key.pem, ca-cert.pem) from the server's TLS directory instead of generating a separate proxy certificate in Tauri. Also trust the server CA in the Windows trust store instead of a self-signed proxy cert. This aligns with the reviewer feedback to avoid duplicating certificate management across the codebase.
Run remote windows through a server-backed HTTPS proxy so desktop reuses the CLI TLS assets and keeps auth, cleanup, and platform-specific TLS handling in one place. This also hardens Windows/Linux/macOS behavior, restores tauri-dev support, and removes the obsolete in-process Tauri proxy. Co-authored-by: Shantur Rathore <i@shantur.com>
4dddd60 to
07345ce
Compare
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/24633912717 Artifacts expire in 7 days. |
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
@pascalandr - I just reviewed old state of PR (before force push), not sure if these are changed. We need to handle the following
|
|
I reviewed the latest PR state as a fresh gatekeeper pass for the current server-backed proxy design. I interpreted the request as: check the newest diff against Findings
What I Re-checked
Validation Notes
Residual risk:
-- |
Verify the installed local CA against the active macOS user keychain before persisting trust state, and add focused server-side tests for remote proxy activation, path rewriting, cookie rewriting, and session cleanup.
|
@shantur |
|
Hey @pascalandr
That's correct. If there is no TLS verification then the remote origin will be exactly what server is talking to so the auth/cookies should work without any re-writing. This is how electron implementation works for remote urls. |
|
@shantur How should we handle macOS here, since Tauri/Wry does not seem to expose a simple per-window TLS error hook like Electron does? |
Current macOS implementation in your PR is to install the certificate in OS store similar to Windows to trust the local CodeNomad cert. This works in macOS too. I have tested it |
|
@pascalandr - Seems like this PR also reverts the shell rc changes that were merged |
@shantur sorry but I'm still confused about what your mean : |
Yes, when Tauri doesn't need to escape SSL verification, it should bypass the local proxy and open the remote URL on all 3 platforms. |
Open remote HTTPS URLs directly in Tauri when certificate verification remains enabled, and keep the local HTTPS proxy path only for tlsSkipVerify flows. Also restore bash/zsh interactive shell startup and verify actual trust-store state before skipping local certificate installation prompts on Windows.
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
I reviewed the latest PR state as a fresh gatekeeper pass after the new Findings
What Changed Since My Previous Pass
Validation Notes
Residual risk:
-- |
|
@shantur |
|
sorry for the confusing discussion, the true asked behavior is : So when tlsSkipVerify=true - Verification is skipped then we need to go via Local Proxy When tlsSkipVerify=false - We need to use the Remote URL directly. with these updated information can you perform a review again ? |
|
I reviewed the latest PR state again using the clarified TLS contract from this thread. I interpreted the intended behavior as:
With that updated understanding, I do not have any gatekeeper findings on the current branch tip. What I Re-checked
Validation Notes
Residual risk:
-- |
|
Thanks for awesome work @pascalandr |
Summary
packages/serverwith per-session bootstrap, local-only cleanup, and explicit session lifecycle handlingtauri dev, and updated Linux/macOS handling for the new local HTTPS proxy pathTesting
npm run build --workspace @neuralnomads/codenomadcargo checknpm run build --workspace @codenomad/tauri-appNotes