How to Configure Firefox to Trust Windows System CA Certificates for HTTPS Inspection


2 views

When organizations implement HTTPS inspection through firewalls like Palo Alto, FortiGate, or Cisco, they typically deploy custom CA certificates across Windows machines via Group Policy. While this works seamlessly for browsers using the Windows Certificate Store (Chrome, Edge, IE), Firefox's independent certificate management causes headaches for sysadmins.

Unlike Chromium-based browsers, Firefox maintains its own certificate store in the cert8.db or cert9.db file (depending on version). The key files are located in:

%APPDATA%\\Mozilla\\Firefox\\Profiles\\[random].default

For Windows environments, consider these approaches:

1. Policy-Based Deployment (Recommended)

Create a policies.json file in the Firefox installation directory:

{
  "policies": {
    "Certificates": {
      "ImportEnterpriseRoots": true,
      "Install": [
        "C:\\path\\to\\your\\CA.crt"
      ]
    }
  }
}

2. PowerShell Deployment Script

For mass deployment of certificates:

# Convert .cer to .crt if needed
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import("C:\FirewallCA.cer")
[System.IO.File]::WriteAllBytes("C:\FirewallCA.crt", $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert))

# Copy to Firefox cert store
Copy-Item "C:\FirewallCA.crt" -Destination "$env:APPDATA\Mozilla\Firefox\Profiles\*.default"

For fine-grained control, modify prefs.js:

user_pref("security.enterprise_roots.enabled", true);
user_pref("security.cert_pinning.enforcement_level", 1);

After implementation, verify through Firefox's certificate manager:

  1. Navigate to about:preferences#privacy
  2. Click "View Certificates"
  3. Check "Authorities" tab for your CA

If certificates still aren't trusted:

  • Ensure the CA cert has proper trust flags (check with certmgr.msc)
  • Verify Firefox ESR version for enterprise compatibility
  • Check for conflicting policies in about:config

When organizations implement HTTPS inspection through firewalls or proxies, Firefox's independent certificate store becomes a significant pain point. Unlike Chromium-based browsers that inherit the Windows certificate store, Firefox maintains its own trust chain through cert9.db and key4.db files.

For Windows domain environments, these are the most effective approaches:

1. Policy-Based Deployment (Recommended)

// Sample PowerShell script to deploy certs to Firefox
$certPath = "C:\Temp\EnterpriseRootCA.crt"
$certName = "Enterprise Root CA"

# Import to Firefox cert store
& "C:\Program Files\Mozilla Firefox\firefox.exe" --headless --import-certificate $certPath --cert-name "$certName"

2. Registry Configuration

Create a policies.json file in the Firefox installation directory:

{
  "policies": {
    "Certificates": {
      "ImportEnterpriseRoots": true,
      "Install": ["C:\\path\\to\\your\\ca.crt"]
    }
  }
}

For system administrators needing deeper control:

Certificate Database Management

# Using certutil (part of NSS tools)
certutil -A -n "Enterprise CA" -t "TCu,Cu,Tu" -i enterprise_ca.crt -d sql:%PROGRAMFILES%\Mozilla Firefox

Group Policy Objects

Create an ADMX template for Firefox policies with these key settings:

; Firefox ADMX Template Excerpt
POLICY "Trust Enterprise CAs"
  SUPPORTED "Firefox 60+"
  EXPLAIN "Forces Firefox to trust Windows Certificate Store"
  
  PART "Enterprise Root Import" CHECKBOX
    VALUENAME "ImportEnterpriseRoots"
    VALUEON NUMERIC 1
    VALUEOFF NUMERIC 0
  END PART
END POLICY

After implementation, verify with:

about:certificate?cert=Enterprise%20CA

Check the certificate chain in Firefox's Certificate Manager (accessed via about:preferences#privacy).

For environments where direct modification isn't possible:

  • Deploy Firefox ESR with pre-configured profiles
  • Use CCK2 Wizard to create customized installations
  • Consider Enterprise Policy Engine for large deployments

Remember that:

  1. HTTPS inspection breaks end-to-end encryption
  2. Firefox's model provides better security by default
  3. Enterprise CA certificates should have proper CRL/OCSP configuration