【问题标题】:Programmatically Install Certificate into Mozilla以编程方式将证书安装到 Mozilla
【发布时间】:2010-11-28 22:21:48
【问题描述】:

有没有办法以编程方式将证书安装到 mozilla 中?我们正在尝试编写所有脚本以消除环境偏差,因此通过 Mozilla 首选项手动安装它不能满足我们的需求。 我认为有一种方法可以使用 certutil 来实现,但我不确定 Mozilla 的内部结构等。

【问题讨论】:

标签: firefox certificate


【解决方案1】:

最简单的方法是将证书导入到示例 firefox 配置文件中,然后将 cert8.db 复制到要配备证书的用户。

首先将证书手动导入到示例用户的 Firefox 配置文件中。然后复制

  • /home/${USER}/.mozilla/firefox/${randomalphanum}.default/cert8.db (Linux/Unix)

  • %userprofile%\Application Data\Mozilla\Firefox\Profiles\%randomalphanum%.default\cert8.db (Windows)

进入用户 firefox-profiles。而已。如果您想确保新用户自动获得证书,请将cert8.db 复制到:

  • /etc/firefox-3.0/profile (Linux/Unix)

  • %programfiles%\firefox-installation-folder\defaults\profile (Windows)

【讨论】:

  • 宾果游戏。现在我知道证书数据库在哪里,我可以从那里使用 certutil。谢谢。
  • 没有更简单的方法。 Firefox 在全新安装后工作。如果cert8.db 中的证书数据库被删除,它将在下一次 Firefox 启动时重新生成。这强烈表明存在系统范围的 CA 证书默认存储。 Firefox 的源代码 shows 内置 CA 证书实际上被硬编码到 firefox 可执行文件中。他们居住在security/nss/lib/ckfw/builtins/certdata.txt
  • 对于 mac,它位于此处:/Users/${USER}/Library/Application Support/Firefox/Profiles/hpc6g9rx.default/cert8.db
【解决方案2】:

这是一种不覆盖现有证书的替代方法: [linux系统的bash片段]

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 软件包 (debian/ubuntu) 中找到 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

【讨论】:

  • 感谢您提供的这种方法,它对我来说效果很好,可以完全自动化,并且不会覆盖现有证书。应该是公认的答案
  • 我收到以下 Trust flag u is set automatically if the private key is present. 并且证书未在 Firefox 中设置
  • @Naramsim 在这里报告了同样的问题:“注意:如果存在私钥,则会自动设置信任标志 u。”我发现脚本正在创建 cert8.db 而不是更新 cert9.db。我搜索了那个,我发现了这个问题:stackoverflow.com/questions/58550397/… 它有效,它是关于在位置之前添加 sql:。我只是从现在开始手动尝试,这有效: certutil -A -n "Unnamed CERT" -t "TCu,Cuw,Tuw" -i this-is-not-a-name.pem -d sql:"/home /jdoe/.mozilla/firefox/v89uq1080n.default/"
  • @Naramsim 在这里报告了同样的问题。我发现脚本是自动创建 cert8.db 而不是更新 cert9.db。我找到了这个解决方案:stackoverflow.com/questions/58550397/… 它有效,它是关于在位置之前添加'sql:'。我只是从现在开始手动尝试,这有效:'certutil -A -n "Unnamed CERT" -t "TCu,Cuw,Tuw" -i this-is-not-a-name.pem -d sql:"/ home/jdoe/.mozilla/firefox/v89uq1080n.default/"' 你有这个脚本的更新:stackoverflow.com/questions/1435000/…
【解决方案3】:

在带有 Firefox 10 的 Windows 7 上,cert8.db 文件存储在 %userprofile%\AppData\Roaming\Mozilla\Firefox\Profiles\########.default\cert8.db。如果您是管理员,您可能可以编写一个简单的 WMI 应用程序将文件复制到用户的相应文件夹。

另外,http://www.appdeploy.com/messageboards/tm.asp?m=52532&mpage=1&key=&#52532 为我工作的解决方案

  1. CERTUTIL.EXE 从 NSS 压缩文件 (http://www.mozilla.org/projects/security/pki/nss/tools/) 复制到 C:\Temp\CertImport(我还把要导入的证书放在那里)

  2. 将所有 dll 从 NSS zip 文件复制到 C\:Windows\System32

  3. 使用此脚本在%Appdata%\mozilla\firefox\profiles 中创建了一个 BAT 文件...

    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. 执行了 BAT 文件,结果很好。

【讨论】:

    【解决方案4】:

    我在一个客户端站点上遇到了类似的问题,客户端需要为 2000 多个 Windows 用户自动安装授权证书。

    我创建了以下 .vbs 脚本来将证书导入当前登录的用户 firefox 证书存储。

    脚本需要放在包含 certutil.exe(nss 版本)的工作副本的目录中,但会以编程方式确定 firefox 配置文件的位置。

    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
    

    【讨论】:

      【解决方案5】:

      只是想添加到旧线程以希望对其他人有所帮助。我需要使用 GPO 以编程方式将证书添加到 firefox 数据库,这就是我在 Windows 上所做的

      1、首先下载并解压预编译的firefox NSSnss-3.13.5-nspr-4.9.1-compiled-x86.zip

      2、手动添加证书到firefox Options-->Advanced--Certificates-->Authorities-->Import

      3、从下载的NSS包中,运行

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

      4,上面的查询将显示证书名称和信任属性,例如

      my company Ltd                                CT,C,C    
      

      5、在步骤2中删除证书。Options-->Advanced--Certificates-->Authorities-->Delete

      6,使用步骤 4 中的信息创建一个 powershell 脚本,如下所示。此脚本将获取用户配置文件路径并添加证书。这仅适用于用户有一个 firefox 配置文件(需要以某种方式检索用户的 firefox 文件夹配置文件名称)

      #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、将 GPO 创建为用户配置以运行 PowerShell 脚本

      希望这有助于节省某人的时间

      【讨论】:

      • 谢谢。您的解决方案适用于我们的 Windows 机器。除了您的回答之外,certutil 还可以将网络路径用于证书文件和配置文件。
      • 谢谢,上述命令通过将证书添加到 cert8.db 文件中来工作。但是,我无法看到导入到 Firefox 浏览器中的用户证书列表。因此,当我访问正在寻找用户证书的特定链接并且浏览器没有它时,它会显示其他错误。
      【解决方案6】:

      我试图在 Powershell 中实现相同的功能,并编写了一个脚本来执行可以交互选择的各种功能。当然,修改脚本以自动化某些事情而不是提供选项是相当容易的。

      我是一名基础架构人员,而不是一名编码员/程序员,所以如果它有点麻烦(但它确实有效!!),请道歉。

      将以下内容另存为 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
      

      【讨论】:

        【解决方案7】:

        Firefox 现在(从 58 开始)使用 SQLite 数据库 cert9.db 而不是旧的 cert8.db。 我已对此处提供的解决方案进行了修复,以使其适用于新版本的 Firefox:

        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
        

        【讨论】:

        • 这确实应该是答案——它比 cert8.db 答案更新——但我发现我仍然无法预先安装自签名证书被 Firefox 接受。如果您手动接受证书(使用高级 -> 接受风险按钮),证书将出现在“查看证书”对话框的“授权”部分而不是“服务器”部分。
        【解决方案8】:

        最新版本的 Firefox 支持 policies.json 文件,该文件将应用于所有 Firefox 配置文件。

        对于 CA 证书,您有 some options,这是一个示例,使用 Linux/Ubuntu 进行测试,我已经在 /usr/local/share/ca-certificates 中拥有系统范围的 CA 证书:

        /usr/lib/firefox/distribution/policies.json

        {
            "policies": {
                "Certificates": {
                    "Install": [
                        "/usr/local/share/ca-certificates/my-custom-root-ca.crt"
                    ]
                }
            }
        }
        

        对 Thunderbird 的支持是 on its way

        【讨论】:

          【解决方案9】:

          我有一个this awesome answer 的更新(只是不再使用最新的 Firefox 更新),在同一线程中,由H.-Dirk Schmitt 制作,也感谢this other thread 中由BecarioEstrella 制作的答案。

          我刚刚根据最近的变化调整了脚本。

          在 2021 年仅在 Ubuntu 20.04 和 18.04 的 Firefox 85.0.1(64 位)中测试。

          #!/usr/bin/env bash
          
          function usage {
            echo "Error: no certificate filename or name supplied."
            echo "Usage: $ ./installcerts.sh <certname>.pem <Cert-DB-Name>"
            exit 1
          
          }
          
          if [ -z "$1" ] || [ -z "$2" ]
            then
              usage
          fi
          
          certificate_file="$1"
          certificate_name="$2"
          for certDB in $(find  ~/.mozilla* ~/.thunderbird -name "cert9.db")
          do
            cert_dir=$(dirname ${certDB});
            echo "Mozilla Firefox certificate" "install '${certificate_name}' in ${cert_dir}"
            certutil -A -n "${certificate_name}" -t "TCu,Cuw,Tuw" -i ${certificate_file} -d sql:"${cert_dir}"
          done
          

          如果您只希望它用于 Firefox,请替换以下行:

          for certDB in $(find  ~/.mozilla* ~/.thunderbird -name "cert9.db")
          

          for certDB in $(find  ~/.mozilla* -name "cert9.db")
          

          进一步阅读:

          【讨论】:

            猜你喜欢
            • 2012-09-29
            • 2012-10-09
            • 2011-09-11
            • 2011-07-02
            • 1970-01-01
            • 2010-10-27
            • 2010-12-01
            • 2020-06-12
            • 2016-06-14
            相关资源
            最近更新 更多