Programmatically Install Certificate into Mozilla

后端 未结 8 2138
没有蜡笔的小新
没有蜡笔的小新 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 20:59

    Firefox now (since 58) uses a SQLite database cert9.db instead of legacy cert8.db. I have made a fix to a solution presented here to make it work with new versions of 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
    

提交回复
热议问题