2009-09-16 19 views
36

प्रोग्रामिंग रूप से मोज़िला में प्रमाणपत्र स्थापित करने का कोई तरीका है? हम पर्यावरण में विचलन को खत्म करने के लिए सब कुछ लिपि करने की कोशिश कर रहे हैं ताकि इसे मोज़िला प्राथमिकताओं के माध्यम से हाथ से स्थापित करना हमारी आवश्यकताओं के लिए काम न करे। मुझे लगता है कि यह प्रमाणन के साथ ऐसा करने का एक तरीका है, लेकिन मुझे मोज़िला के आंतरिक, आदि के बारे में निश्चित नहीं है।मोज़िला में प्रोग्रामेटिक रूप से प्रमाणपत्र स्थापित करें

+0

भी देखें पास नकल http://askubuntu.com/questions/244582/add-certificate-authorities-: मैं इसे फ़ायरफ़ॉक्स के नए संस्करणों के साथ काम करने के लिए यहाँ प्रस्तुत एक समाधान करने के लिए एक ठीक बना दिया है सिस्टम-वाइड-ऑन-फ़ायरफ़ॉक्स जो वर्तमान में बहुत अधिक मूल्य प्रदान नहीं करता है। – tripleee

+0

प्रमाण पत्र स्वीकार करने के लिए सेलेनियम ड्राइवर का उपयोग करने के लिए एक बेहतर तरीका हो सकता है। http: // stackoverflow।कॉम/प्रश्न/24507078/कैसे-से-सौदा-प्रमाण-उपयोग-सेलेनियम – tavak

उत्तर

20

प्रमाण पत्र को नमूना फ़ायरफ़ॉक्स-प्रोफ़ाइल में आयात करना सबसे आसान तरीका है और फिर cert8.db को कॉपी करें वे उपयोगकर्ता जिन्हें आप प्रमाणपत्र के साथ लैस करना चाहते हैं।

पहले प्रमाण पत्र को नमूना-उपयोगकर्ता की फ़ायरफ़ॉक्स प्रोफ़ाइल में आयात करें। तब उन फ़ायरफ़ॉक्स-प्रोफाइल में

  • /home/${USER}/.mozilla/firefox/${randomalphanum}.default/cert8.db (लिनक्स/यूनिक्स)

  • %userprofile%\Application Data\Mozilla\Firefox\Profiles\%randomalphanum%.default\cert8.db (विंडोज)

कॉपी। बस। आप यह सुनिश्चित करना चाहते हैं, कि नए उपयोगकर्ताओं को स्वचालित रूप से प्रमाण पत्र प्राप्त करने cert8.db कॉपी:

  • /etc/firefox-3.0/profile (लिनक्स/यूनिक्स)

  • %programfiles%\firefox-installation-folder\defaults\profile (विंडोज)

+2

बिंगो। अब जब मुझे पता है कि प्रमाणित डीबी कहां से मैं वहां से प्रमाणपत्र का उपयोग कर सकता हूं। धन्यवाद। – PHeath

+4

कोई आसान तरीका नहीं है। फ़ायरफ़ॉक्स एक साफ स्थापना के बाद काम करता है। यदि 'cert8.db' में प्रमाणपत्र डेटाबेस हटा दिया गया है, तो इसे अगले फ़ायरफ़ॉक्स प्रारंभ पर पुन: उत्पन्न किया जाता है। यह दृढ़ता से सुझाव देता है कि सीए केर्ट्स का एक सिस्टम-व्यापी डिफ़ॉल्ट भंडारण है। फ़ायरफ़ॉक्स का स्रोत कोड [शो] (https://github.com/mozilla/gecko-dev/blob/master/security/nss/lib/ckfw/builtins/Makefile#L52) जो अंतर्निहित सीए केर्ट्स वास्तव में हैं 'फ़ायरफ़ॉक्स' निष्पादन योग्य में हार्ड कोडित। वे [सुरक्षा/एनएसएस/lib/ckfw/buildins/certdata.txt] में रहते हैं (https://github.com/mozilla/gecko-dev/blob/master/security/nss/lib/ckfw/builtins/certdata.txt) – yanychar

+2

मैक के लिए, यह यहां स्थित था:/उपयोगकर्ता/$ {USER}/लाइब्रेरी/एप्लिकेशन समर्थन/फ़ायरफ़ॉक्स/प्रोफाइल/hpc6g9rx.default/cert8.db –

26

यहाँ है एक वैकल्पिक तरीका जो मौजूदा प्रमाणपत्रों को ओवरराइड नहीं करता है: [लिनक्स सिस्टम के लिए बैश खंड]

certificateFile="MyCa.cert.pem" 
certificateName="MyCA Name" 
for certDB in $(find ~/.mozilla* ~/.thunderbird -name "cert8.db") 
do 
    certDir=$(dirname ${certDB}); 
    #log "mozilla certificate" "install '${certificateName}' in ${certDir}" 
    certutil -A -n "${certificateName}" -t "TCu,Cuw,Tuw" -i ${certificateFile} -d ${certDir} 
done 

आप libnss3-tools पैकेज (डेबियन/उबंटू) में certutil पा सकते हैं।

स्रोत:
http://web.archive.org/web/20150622023251/http://www.computer42.org:80/xwiki-static/exported/DevNotes/xwiki.DevNotes.Firefox.html

भी देखें:
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/tools/NSS_Tools_certutil

+0

इस दृष्टिकोण के लिए धन्यवाद देना चाहता था, जो मेरे लिए अच्छा काम करता है, कर सकता है पूरी तरह से स्वचालित हो, और मौजूदा प्रमाणपत्रों को ओवरराइट नहीं करता है। स्वीकार्य उत्तर होना चाहिए – erjoalgo

4

विंडोज 7 पर फ़ायरफ़ॉक्स 10 के साथ, cert8.db फ़ाइल %userprofile%\AppData\Roaming\Mozilla\Firefox\Profiles\########.default\cert8.db में संग्रहित है। यदि आप एक व्यवस्थापक हैं, तो आप फ़ाइल को उपयोगकर्ता के संबंधित फ़ोल्डर में कॉपी करने के लिए शायद एक साधारण WMI एप्लिकेशन लिख सकते हैं।

इसके अलावा, एक समाधान है कि C:\Temp\CertImport को एनएसएस ज़िप फ़ाइल (http://www.mozilla.org/projects/security/pki/nss/tools/) से http://www.appdeploy.com/messageboards/tm.asp?m=52532&mpage=1&key=&#52532

  1. कॉपी किया गया CERTUTIL.EXE से मेरे लिए काम किया (मैं भी रखा प्रमाण पत्र मैं वहाँ आयात करना चाहते हैं)

  2. सभी डीएलएस को एनएसएस ज़िप फ़ाइल से C\:Windows\System32

  3. इस स्क्रैग के साथ %Appdata%\mozilla\firefox\profiles में एक बीएटी फ़ाइल बनाई गई आईपीटी ...

    Set FFProfdir=%Appdata%\mozilla\firefox\profiles 
    Set CERTDIR=C:\Temp\CertImport 
    DIR /A:D /B > "%Temp%\FFProfile.txt" 
    FOR /F "tokens=*" %%i in (%Temp%\FFProfile.txt) do ( 
    CD /d "%FFProfDir%\%%i" 
    COPY cert8.db cert8.db.orig /y 
    For %%x in ("%CertDir%\Cert1.crt") do "%Certdir%\certutil.exe" -A -n "Cert1" -i "%%x" -t "TCu,TCu,TCu" -d . 
    For %%x in ("%CertDir%\Cert2.crt") do "%Certdir%\certutil.exe" -A -n "Cert2" -i "%%x" -t "TCu,TCu,TCu" -d . 
    ) 
    DEL /f /q "%Temp%\FFProfile.txt" 
    
  4. अच्छे परिणामों के साथ बीएटी फ़ाइल निष्पादित किया गया।

+0

धन्यवाद आदमी महान soln – Lanaru

1

मैं एक ग्राहक साइट जहां ग्राहक की आवश्यकता एक अधिकार प्रमाण पत्र 2000 + खिड़कियों उपयोगकर्ताओं के लिए स्वचालित रूप से स्थापित होने के लिए पर एक समान समस्या हुई।

मैंने फ़ायरफ़ॉक्स प्रमाणपत्र स्टोर पर वर्तमान लॉग इन प्रमाणपत्र में प्रमाणपत्र आयात करने के लिए निम्न .vbs स्क्रिप्ट बनाई है।

स्क्रिप्ट को certutil.exe (एनएसएस संस्करण) की एक कार्यशील प्रतिलिपि वाली निर्देशिका में डालने की आवश्यकता है लेकिन प्रोग्रामेटिक रूप से फ़ायरफ़ॉक्स प्रोफाइल स्थान निर्धारित करता है।

Option Explicit 

On error resume next 

Const DEBUGGING    = true 
const SCRIPT_VERSION  = 0.1 
Const EVENTLOG_WARNING  = 2 
Const CERTUTIL_EXCUTABLE = "certutil.exe" 
Const ForReading = 1 


Dim strCertDirPath, strCertutil, files, slashPosition, dotPosition, strCmd, message 
Dim file, filename, filePath, fileExtension 

Dim WshShell   : Set WshShell   = WScript.CreateObject("WScript.Shell") 
Dim objFilesystem  : Set objFilesystem = CreateObject("Scripting.FileSystemObject") 
Dim certificates  : Set certificates  = CreateObject("Scripting.Dictionary") 
Dim objCertDir 
Dim UserFirefoxDBDir 
Dim UserFirefoxDir 
Dim vAPPDATA 
Dim objINIFile 
Dim strNextLine,Tmppath,intLineFinder, NickName 

vAPPDATA = WshShell.ExpandEnvironmentStrings("%APPDATA%") 
strCertDirPath = WshShell.CurrentDirectory 
strCertutil  = strCertDirPath & "\" & CERTUTIL_EXCUTABLE 
UserFirefoxDir = vAPPDATA & "\Mozilla\Firefox" 
NickName = "Websense Proxy Cert" 


Set objINIFile = objFilesystem.OpenTextFile(UserFireFoxDir & "\profiles.ini", ForReading) 

Do Until objINIFile.AtEndOfStream 
    strNextLine = objINIFile.Readline 

    intLineFinder = InStr(strNextLine, "Path=") 
    If intLineFinder <> 0 Then 
     Tmppath = Split(strNextLine,"=") 
     UserFirefoxDBDir = UserFirefoxDir & "\" & replace(Tmppath(1),"/","\") 

    End If 
Loop 
objINIFile.Close 

'output UserFirefoxDBDir 

If objFilesystem.FolderExists(strCertDirPath) And objFilesystem.FileExists(strCertutil) Then 
    Set objCertDir = objFilesystem.GetFolder(strCertDirPath) 
    Set files = objCertDir.Files 

    For each file in files 
     slashPosition = InStrRev(file, "\") 
     dotPosition = InStrRev(file, ".") 
     fileExtension = Mid(file, dotPosition + 1) 
     filename  = Mid(file, slashPosition + 1, dotPosition - slashPosition - 1) 

     If LCase(fileExtension) = "cer" Then   
      strCmd = chr(34) & strCertutil & chr(34) &" -A -a -n " & chr(34) & NickName & chr(34) & " -i " & chr(34) & file & chr(34) & " -t " & chr(34) & "TCu,TCu,TCu" & chr(34) & " -d " & chr(34) & UserFirefoxDBDir & chr(34) 
      'output(strCmd) 
      WshShell.Exec(strCmd) 
     End If   
    Next   
    WshShell.LogEvent EVENTLOG_WARNING, "Script: " & WScript.ScriptFullName & " - version:" & SCRIPT_VERSION & vbCrLf & vbCrLf & message 
End If 

function output(message) 
    If DEBUGGING Then 
     Wscript.echo message 
    End if 
End function 

Set WshShell = Nothing 
Set objFilesystem = Nothing 
11

बस अन्य लोगों की सहायता करने के लिए पुराने धागे में जोड़ना चाहता था। मैं प्रोग्राम के रूप में एक जीपीओ का उपयोग कर फ़ायरफ़ॉक्स डेटाबेस के लिए एक प्रमाणपत्र जोड़ने की जरूरत है, इस था मैं कैसे यह विंडोज

1, सबसे पहले डाउनलोड के लिए किया था और precompiled फ़ायरफ़ॉक्स एनएसएस nss-3.13.5-nspr-4.9.1-compiled-x86.zip

2 अनज़िप, फ़ायरफ़ॉक्स विकल्प के लिए मैन्युअल प्रमाणपत्र जोड़ें -> उन्नत - प्रमाण पत्र -> प्राधिकारी -> आयात

3, डाउनलोड की एनएसएस पैकेज से,

certutil -L -d c:\users\[username]\appdata\roaming\mozilla\firefox\[profile].default  

4 चलाने के लिए, ऊपर क्वेरी आप प्रमाणपत्र नाम प्रदर्शित करेंगे और विश्वास जैसे गुण

my company Ltd        CT,C,C  

5, चरण में प्रमाण पत्र हटाएं 2. विकल्प -> उन्नत - प्रमाण पत्र -> प्राधिकारी -> हटाएं

6, इस प्रकार चरण 4 से जानकारी का उपयोग कर एक powershell स्क्रिप्ट बनाएं । इस स्क्रिप्ट को उपयोगकर्ता प्रोफाइल पथ मिलेगा और प्रमाणपत्र जोड़ें। यह केवल काम करता है अगर उपयोगकर्ता एक फ़ायरफ़ॉक्स प्रोफ़ाइल है

#Script adds Radius Certificate to independent Firefox certificate store since the browser does not use the Windows built in certificate store  


#Get Firefox profile cert8.db file from users windows profile path 
$ProfilePath = "C:\Users\" + $env:username + "\AppData\Roaming\Mozilla\Firefox\Profiles\" 
$ProfilePath = $ProfilePath + (Get-ChildItem $ProfilePath | ForEach-Object { $_.Name }).ToString() 

#Update firefox cert8.db file with Radius Certificate 
certutil -A -n "UK my company" -t "CT,C,C" -i CertNameToAdd.crt -d $ProfilePath  

7, एक उपयोगकर्ता विन्यास PowerShell स्क्रिप्ट

आशा है कि बचत होती है चलाने के लिए के रूप में जीपीओ बनाएँ (उपयोगकर्ताओं फ़ायरफ़ॉक्स फ़ोल्डर प्रोफ़ाइल नाम पुनः प्राप्त करने के किसी भी तरह की जरूरत है) किसी का समय

+0

धन्यवाद। आपका समाधान हमारी विंडोज मशीनों के लिए सही तरीके से काम करता है। आपके उत्तर के अतिरिक्त, प्रमाणपत्र फ़ाइल प्रमाणपत्र और प्रोफाइल के लिए नेटवर्क पथ का उपयोग कर सकते हैं। – ozy

1

मैं पावरहेल में एक ही चीज़ प्राप्त करने की कोशिश कर रहा था और विभिन्न कार्यों को करने के लिए एक स्क्रिप्ट लिखी जिसे इंटरैक्टिव रूप से चुना जा सकता है। बेशक, विकल्पों को प्रदान करने के बजाय कुछ चीजों को स्वचालित करने के लिए स्क्रिप्ट को संशोधित करना काफी आसान है।

मैं एक कोडर/प्रोग्रामर की बजाय इंफ्रास्ट्रक्चर लड़का हूं, इसलिए माफी माँगती है अगर यह थोड़ा बोझिल है (लेकिन यह काम करता है !!)।

सहेजें एक PS1 के रूप में निम्नलिखित:

################################################################################################## 
# 
# NAME: RegisterFireFoxCertificates.ps1 
# 
# AUTHOR: Andy Pyne 
# 
# DATE : 22.07.2015 
# 
# COMMENT: To provide options for listing, adding, deleting and purging 
# FireFox Certificates using Mozilla's NSS Util CertUtil 
# Source: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/tools/NSS_Tools_certutil 
# 
# NOTE: You need a copy of the NSS Util CertUtil and it's associated dll's 
# The specific files I used were: 
# 
# certutil.exe, fort32.dll, freebl3.dll, libnspr4.dll, libplc4.dll, libplds4.dll, nspr4.dll, 
# nss3.dll, nssckbi.dll, nssdbm3.dll, nssutil3.dll, plc4.dll, plds4.dll, smime3.dll, 
# softokn3.dll, sqlite3.dll, ssl3.dll, swft32.dll 
# 
################################################################################################## 

################################################################################################## 

# Setup a few parameters 
$ErrorActionPreference = "Silentlycontinue" 
$ExecutionPolicyOriginal = Get-ExecutionPolicy 
$FireFoxExecutable = "C:\Program Files (x86)\Mozilla Firefox\Firefox.exe" 

# This is the Firefox certificate database 
$CertDB = "Cert8.db" 

# The Certificate Nickname is a name you want to see on the certificates that you've imported in - so you know they were imported by this process 
# However, when you look at the certificates in Firefox, they will be listed under whatever the certificate name was when it was generated 
# So if your certificate is listed as 'Company123' when imported, it will still be called that as the Common Name, but when you click to view 
# it, you will see that the first item in the Certificate Fields is what you 'nicknamed' it. 
$CertificateNickname = "MyCompanyName FF AutoImport Cert" 

# The Legacy Certificates are specific/explicit certificates which you wish to delete (The 'purge' option later in the script references these items) 
$LegacyCertificates = @("OldCertificate1", "Company Cert XYZ", "Previous Company name", "Unwanted Certificate - 7", "123APTEST123") 

# This is the list of databases/Firefox profiles on the machine 
$FFDBList = @() 

# Making sure our temporary directory is empty 
$FFCertLocationLocal = "C:\FFCertTemp" 

# The remote location of the certificates and 
$FFCertLocationRemote = "\\myUNC\NETLOGON\FireFoxCert\" 

# The local CertUtil executable (this is copied from the remote location above) 
$FFCertTool = "$FFCertLocationLocal\CertUtil.exe" 

# Making sure our temporary directory is empty 
Remove-Item $FFCertLocationLocal -Recurse 
New-Item -ItemType Directory -Path $FFCertLocationLocal 

################################################################################################## 

################################################################################################## 


Clear 

# We're going to get a list of the Firefox processes on the machine that are open and close them 
# Otherwise the add/delete parts might not be successful with Firefox still running 
$FireFoxRunningProcessesList = Get-Process | Where-Object {$_.Name -Match "FireFox"} | Select-Object ProcessName,Id | Format-Table -AutoSize 
$FireFoxRunningProcesses = Get-Process | Where-Object {$_.Name -Match "FireFox"} | Select-Object -ExpandProperty Id 
If (!$FireFoxRunningProcesses) {} 
Else { 
Write-Host "The following processes will be stopped to perform certificate manipulation:" 
$FireFoxRunningProcessesList 
$TerminateProcessQuestion = Read-Host "To auto-terminate (ungracefully!) processes, press 'Y', otherwise, press any other key" 
If ($TerminateProcessQuestion -ne 'y') { 
Clear 
Write-Host "Cannot continue as Firefox process is still running, ending script ..." 
Exit} 
Else {ForEach ($FireFoxRunningProcess in $FireFoxRunningProcesses) { 
[Int]$FireFoxRunningProcess = [Convert]::ToInt32($FireFoxRunningProcess, 10) 
Stop-Process -Id $FireFoxRunningProcess -Force}} 
} 

################################################################################################## 

################################################################################################## 

# The remote files (certificates and the NSS Tools CertUtil files are copied locally) 
$FFCertificateListItemRemote = Get-ChildItem $FFCertLocationRemote -Recurse -Include *.cer,*.dll,certutil.exe 
ForEach ($FFCertificateItemRemote in $FFCertificateListItemRemote) { 
Copy-Item $FFCertificateItemRemote.FullName -Destination $FFCertLocationLocal} 

# Get a list of the local certificates 
$FFCertificateListLocal = Get-ChildItem $FFCertLocationLocal -Recurse -filter *.cer 

Clear 
Set-ExecutionPolicy "Unrestricted" 

# Find all Firefox profiles and create an array called FFDBList 
# Of course, you'll only be able to get to the ones your permissions allow 
$LocalProfiles = Get-ChildItem "C:\Users" | Select-Object -ExpandProperty FullName 
ForEach ($LocalProfile in $LocalProfiles) { 
$FFProfile = Get-ChildItem "$LocalProfile\AppData\Roaming\Mozilla\Firefox\Profiles" | Select-Object -ExpandProperty FullName 
If (!$FFProfile) {Write-Host "There is no Firefox Profile for $LocalProfile"} 
ELSE {$FFDBList += $FFProfile} 
} 

Clear 
Write-Host "#################################" 
Write-Host "The List of FireFox Profiles is:" 
Write-Host "#################################" 
$FFDBList 
PAUSE 

################################################################################################## 

################################################################################################## 

# Setup 4x functions (List, Delete, Add and Purge) 
# 
# - List will simply list certificates from the Firefox profiles 
# 
# - Delete will delete the certificates the same as the certificates you're going to add back in 
# So for example, if you have 2x certificates copied earlier for import, 'CompanyA' and 'CompanyZ' 
# then you can delete certificates with these names beforehand. This will prevent the 
# certificates you want to import being skipped/duplicated because they already exist 
# 
# - Add will simply add the list of certificates you've copied locally 
# 
# - Purge will allow you to delete 'other' certificates that you've manually listed in the 
# variable '$LegacyCertificates' at the top of the script 

# Each of the functions perform the same 4x basic steps 
# 
# 1) Do the following 3x things for each of the Firefox profiles 
# 2) Do the 2x following things for each of the certificates 
# 3) Generate an expression using parameters based on the certificate nickname specified 
# earlier, and the profile and certificate informaiton 
# 4) Invoke the expression 

Function ListCertificates { 
Write-Host "#############################" 
ForEach ($FFDBItem in $FFDBList) { 
$FFCertificateListItemFull = $FFCertificateListItem.FullName 
Write-Host "Listing Certificates for $FFDBitem" 
$ExpressionToListCerts = "$FFCertTool -L -d `"$FFDBItem`"" 
Invoke-Expression $ExpressionToListCerts 
} 
PAUSE} 

Function DeleteOldCertificates { 
Write-Host "#############################" 
ForEach ($FFDBItem in $FFDBList) { 
ForEach ($FFCertificateListItem in $FFCertificateListLocal) { 
$FFCertificateListItemFull = $FFCertificateListItem.FullName 
Write-Host "Deleting Cert $FFCertificateListItem for $FFDBitem" 
$ExpressionToDeleteCerts = "$FFCertTool -D -n `"$CertificateNickname`" -d `"$FFDBItem`"" 
Invoke-Expression $ExpressionToDeleteCerts 
}} 
PAUSE} 

Function AddCertificates { 
Write-Host "#############################" 
ForEach ($FFDBItem in $FFDBList) { 
ForEach ($FFCertificateListItem in $FFCertificateListLocal) { 
$FFCertificateListItemFull = $FFCertificateListItem.FullName 
Write-Host "Adding $FFCertificateListItem Cert for $FFDBitem" 
$ExpressionToAddCerts = "$FFCertTool -A -n `"$CertificateNickname`" -t `"CT,C,C`" -d `"$FFDBItem`" -i `"$FFCertificateListItemFull`"" 
Write-Host $ExpressionToAddCerts 
Invoke-Expression $ExpressionToAddCerts 
#PAUSE 
}} 
PAUSE} 

Function PurgeLegacyCertificates { 
Write-Host "#############################" 
ForEach ($FFDBItem in $FFDBList) { 
ForEach ($LegacyCertificateItem in $LegacyCertificates) { 
$LegacyCertificateItemFull = $LegacyCertificateItem.FullName 
Write-Host "Purging Old Certs ($LegacyCertificateItem) for $FFDBitem" 
#$ExpressionToDeleteLegacyCerts = "$FFCertTool -D -n `"$OldCertificate`" -d `"$FFDBItem`"" 
$ExpressionToDeleteLegacyCerts = "$FFCertTool -D -n `"$LegacyCertificateItem`" -d `"$FFDBItem`"" 
ForEach ($LegacyCertificate in $LegacyCertificates) { 
Invoke-Expression $ExpressionToDeleteLegacyCerts} 
}} 
PAUSE} 

################################################################################################## 

################################################################################################## 

    # Creating a few options to invoke the various functions created above 

$CertificateAction = "" 

Function CertificateActionSelection { 
Do { 
Clear 
$CertificateAction = Read-Host "Would you like to [L]ist all certificates [D]elete all old certificates, [A]dd new certificates, or [P]urge legacy certificates?" 
} Until ($CertificateAction -eq "L" -or $CertificateAction -eq "D" -or $CertificateAction -eq "A" -or $CertificateAction -eq "P") 

If ($CertificateAction -eq "L") {ListCertificates} 
If ($CertificateAction -eq "D") {DeleteOldCertificates} 
If ($CertificateAction -eq "A") {AddCertificates} 
If ($CertificateAction -eq "P") {PurgeLegacyCertificates} 
} 

Do { 
Clear 
$MoreCertificateActions = Read-Host "Would you like to [L]aunch Firefox (as $env:USERNAME), take a [C]ertificate action, or [Q]uit?" 
If ($MoreCertificateActions -eq "L") { 
Invoke-Item $FireFoxExecutable 
Exit} 
If ($MoreCertificateActions -eq "C") {CertificateActionSelection} 

} Until ($MoreCertificateActions -eq "Q") 

Remove-Item $FFCertLocationLocal -Recurse 
Set-ExecutionPolicy $ExecutionPolicyOriginal 

Exit 
0

फ़ायरफ़ॉक्स अब (58 के बाद से) विरासत cert8.db के बजाय एक SQLite डेटाबेस cert9.db उपयोग करता है।

certificateFile="MyCa.cert.pem" 
certificateName="MyCA Name" 
for certDB in $(find ~/.mozilla* ~/.thunderbird -name "cert9.db") 
do 
    certDir=$(dirname ${certDB}); 
    #log "mozilla certificate" "install '${certificateName}' in ${certDir}" 
    certutil -A -n "${certificateName}" -t "TCu,Cuw,Tuw" -i ${certificateFile} -d sql:${certDir} 
done 
संबंधित मुद्दे