Skip to content
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

[release/8.0] Add support for Chromium Snap cert trust #57257

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/Shared/CertificateGeneration/UnixCertificateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ private static string GetChromiumNssDb(string homeDirectory)
return Path.Combine(homeDirectory, ".pki", "nssdb");
}

private static string GetChromiumSnapNssDb(string homeDirectory)
{
return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
}

private static string GetFirefoxDirectory(string homeDirectory)
{
return Path.Combine(homeDirectory, ".mozilla", "firefox");
Expand Down Expand Up @@ -732,13 +737,21 @@ private static List<NssDb> GetNssDbs(string homeDirectory)
return nssDbs;
}

// Chrome, Chromium, Edge, and their respective snaps all use this directory
// Chrome, Chromium, and Edge all use this directory
var chromiumNssDb = GetChromiumNssDb(homeDirectory);
if (Directory.Exists(chromiumNssDb))
{
nssDbs.Add(new NssDb(chromiumNssDb, isFirefox: false));
}

// Chromium Snap, when launched under snap confinement, uses this directory
// (On Ubuntu, the GUI launcher uses confinement, but the terminal does not)
var chromiumSnapNssDb = GetChromiumSnapNssDb(homeDirectory);
if (Directory.Exists(chromiumSnapNssDb))
{
nssDbs.Add(new NssDb(chromiumSnapNssDb, isFirefox: false));
}

var firefoxDir = GetFirefoxDirectory(homeDirectory);
if (Directory.Exists(firefoxDir))
{
Expand Down
Loading