Programmatically Install Certificate into Mozilla

后端 未结 8 2121
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 20:28

Is there a way to programmatically install a certificate into mozilla? We\'re trying to script everything to eliminate deviations in environment so installing it by hand thr

8条回答
  •  时光取名叫无心
    2020-11-28 21:12

    Here is an alternative way that doesn't override the existing certificates: [bash fragment for linux systems]

    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
    

    You may find certutil in the libnss3-tools package (debian/ubuntu).

    Source:
    http://web.archive.org/web/20150622023251/http://www.computer42.org:80/xwiki-static/exported/DevNotes/xwiki.DevNotes.Firefox.html

    See also:
    https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/tools/NSS_Tools_certutil

提交回复
热议问题