Class FirefoxCertificateTrust
Firefox-specific CA trust: Windows ImportEnterpriseRoots policy / policies.json,
profile user.js (and prefs.js when Firefox is not running) so Firefox
uses OS roots, plus optional NSS import into the default profile (cert9.db).
Does not write into the Firefox.app bundle (that would invalidate the code signature).
Inheritance
FirefoxCertificateTrust
Namespace: Titanium.Web.Proxy.Network
Assembly: Titanium.Web.Proxy.dll
Syntax
public static class FirefoxCertificateTrust
Properties
|
Edit this page
View Source
LastEnterpriseRootsStep
Declaration
public static string? LastEnterpriseRootsStep { get; }
Property Value
Methods
|
Edit this page
View Source
ClearRootTrustBestEffort(string?)
Clears enterprise-roots policy/prefs (HKCU / user.js). Does not run NSS
certutil — that can hang for minutes on a locked Firefox profile and blocked
Clear/reinstall on "Finishing root CA removal…". Use Trust/Untrust Firefox for NSS.
Declaration
public static void ClearRootTrustBestEffort(string? friendlyName)
Parameters
| Type |
Name |
Description |
| string |
friendlyName |
|
|
Edit this page
View Source
IsFirefoxProcessRunning()
True when a firefox process is running (best-effort).
Declaration
public static bool IsFirefoxProcessRunning()
Returns
|
Edit this page
View Source
IsFirefoxProfilePresent()
True when a Firefox profiles.ini (or common profile root) is present.
Declaration
public static bool IsFirefoxProfilePresent()
Returns
|
Edit this page
View Source
TrustDefaultProfile(X509Certificate2, string)
Imports the CA into the default Firefox profile NSS DB via certutil.
Caller should ensure Firefox is not locking the DB.
Declaration
public static CertificateOsTrustResult TrustDefaultProfile(X509Certificate2 certificate, string friendlyName)
Parameters
Returns
|
Edit this page
View Source
TryClearWindowsEnterpriseRoots()
Clears the HKCU ImportEnterpriseRoots value and profile user.js pref we may have set.
Declaration
public static bool TryClearWindowsEnterpriseRoots()
Returns
|
Edit this page
View Source
TryEnableEnterpriseRootsUserPref()
Enables security.enterprise_roots.enabled in the default Firefox profile
(user.js; also prefs.js when Firefox is not running) so Firefox trusts
OS roots (Windows store / macOS Keychain / Linux system CAs).
Declaration
public static CertificateOsTrustResult TryEnableEnterpriseRootsUserPref()
Returns
|
Edit this page
View Source
TryEnableWindowsEnterpriseRoots()
Windows: enable OS-root trust for Firefox via HKCU policy when allowed,
otherwise set security.enterprise_roots.enabled in the default profile user.js.
Also best-effort writes/merges Mozilla policies.json on all OSes.
Declaration
public static CertificateOsTrustResult TryEnableWindowsEnterpriseRoots()
Returns
|
Edit this page
View Source
TryRequestFirefoxQuit(TimeSpan?)
Asks Firefox to quit gracefully (user already consented). Waits briefly for exit.
Does not force-kill; returns false if Firefox is still running after the wait.
Declaration
public static bool TryRequestFirefoxQuit(TimeSpan? waitForExit = null)
Parameters
| Type |
Name |
Description |
| TimeSpan? |
waitForExit |
|
Returns
|
Edit this page
View Source
TryResolveDefaultProfileDirectory(out string, out string?)
Resolves the default Firefox profile directory from profiles.ini.
Declaration
public static bool TryResolveDefaultProfileDirectory(out string profileDirectory, out string? error)
Parameters
Returns
|
Edit this page
View Source
UntrustDefaultProfile(string)
Best-effort removal of the CA nickname from the default Firefox profile.
Declaration
public static bool UntrustDefaultProfile(string friendlyName)
Parameters
| Type |
Name |
Description |
| string |
friendlyName |
|
Returns