Discussion: drop new Firefox notice, rely on existing notice + refetch-on-focus#3488
Draft
ivan-ottinger wants to merge 1 commit into
Conversation
Alternative to the new Firefox notice: rely on the existing untrusted-cert notice + refetchOnFocus (already enabled on certificateTrustApi) to surface the case where Firefox is opened after the initial Trust click and a new profile DB appears without the Studio CA. - Remove the Firefox notice in content-tab-settings - Remove isFirefoxInstalledOnLinux + detect-linux-browsers tests - Remove getLinuxBrowserCertSupportStatus IPC handler + preload binding - Remove the second RTK Query endpoint + hook - Remove docsSslLinuxFirefox (rely on docsSslInStudio) - Keep the substantive fix: importCAIntoFirefoxProfilesLinux, areAllFirefoxProfilesTrustedLinux, getLinuxFirefoxProfileDbDirs, and the composition in isRootCATrusted / trustRootCA Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 task
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related issues
Context
This is a draft companion to #3472 to make the alternative I sketched in this review thread easier to look at as code. It's not a merge candidate — it targets #3472's branch so the diff shows exactly what I'd remove and what I'd keep relative to that PR. Close it once we agree on a direction.
What this PR proposes
Keep the substantive fix from #3472 (auto-importing the Studio CA into existing Firefox profile NSS DBs, and including Firefox profiles in the trust check). Drop the new in-app Firefox notice and the IPC/detection plumbing that exists only to feed it.
Both PRs benefit from
refetchOnFocus: true(already set oncertificateTrustApisince the monorepo restructure) +setupListeners(store.dispatch)(already wired instores/index.ts). When the user opens Firefox for the first time after clicking Trust, the next focus event re-runsisRootCATrusted(), the freshly-created profile DB no longer satisfiesareAllFirefoxProfilesTrustedLinux, and trust flips back to false. In #3472 both the existing notice and the new Firefox-specific notice reappear; in this alternative only the existing notice does. One more Trust click imports into the new profile with no sudo prompt (system bundle install is skipped when the cert is already in/etc/ssl/certs).Proposed Changes
Removed (only exists to feed the new notice):
apps/studio/src/lib/detect-linux-browsers.ts+ its testgetLinuxBrowserCertSupportStatusIPC handler inipc-handlers.tspreload.tsgetLinuxBrowserCertSupportStatusRTK Query endpoint + hook incertificate-trust-api.tsdocsSslLinuxFirefoxinget-localized-link.ts(rely on the existingdocsSslInStudiopage with a Linux/Firefox subsection)isLinuxanduseGetLinuxBrowserCertSupportStatusQueryimports incontent-tab-settings.tsxKept (the substantive fix from #3472):
importCAIntoFirefoxProfilesLinux,areAllFirefoxProfilesTrustedLinux,getLinuxFirefoxProfileDbDirsintools/common/lib/linux-trust-store.tsisRootCATrusted()and the import call intrustRootCA()Net diff vs. #3472: −128 lines, +4 lines.
Why I think this is worth considering
firefoxDetected && !isCertificateTrusted, including when Firefox is installed but no profile exists yet. In that state the copy says "import it manually to avoid the security warning" even though there's nothing to import into — and when the user does open Firefox later, the auto-import will handle it for them on the next Trust click. The alternative defers to the existing notice, which makes no Firefox-specific promise it can't keep.Testing Instructions
The following were verified end-to-end on a Linux VM with Snap Firefox installed:
npx vitest run tools/common/lib/tests/linux-trust-store.test.ts— 12/12; full studio suite 82 files / 639 tests).Findings outside this PR's scope
During testing we hit a pre-existing bug in the trust check that's independent of which notice approach lands:
certutil -L -d sql:<db> -n "WordPress Studio CA"fails to verify trust when the cert exists in the NSS DB under a different nickname — e.g., the<CN> - <Org>pattern Firefox uses when a user manually imports via the certificate manager. NSS dedupes by certificate content on-A, keeping the existing nickname, so the cert ends up trusted but Studio's UI continues to nag. Pattern was introduced in #3268 (Chromium NSS) and inherited by #3472 (Firefox profiles, where the collision is more likely). To be filed and fixed separately.Pre-merge Checklist