需要使用我们自己的根证书来帮助自动化Thunderbird部署

我们正在实验室中build立一个自我托pipe的邮件解决scheme,我们被要求成为我们自己的CA. 我们遇到的问题是Thundebird抱怨说我们的根证书是不可信的,即使我们知道它是有效的。

问题是Thunderbird附带了它自己信任的证书,而且它不会查看计算机的可信证书,所以只要将GPO推送到具有根证书的所有客户端都不起作用。

我们需要自动将根证书导入到Thundebird中,并且在解决问题时遇到严重的问题。

Autoconfig正在工作,雷鸟正在获得正确的服务器configuration,但证书错误仍然存​​在。 唯一已知的方法是手动将证书导入到Thunderbirds可信证书。

这里有人有什么build议如何进行?

由于Thunderbird基于与Firefox相同的平台,因此您应该可以使用Firefox将使用的相同工具。

按照从最简单到最复杂的顺序,您可以使用多种工具选项:

1.它可能是内置的!

Thunderbird拥有从OS证书商店自动导入证书的实验支持。

以下是如何手动启用它的方法:

  1. 打开菜单,然后点击“选项”
  2. 转到“高级”选项卡
  3. 点击“configuration编辑器”
  4. 点击“我接受风险!” 如果提示的话。
  5. searchsecurity.enterprise_roots.enabled
  6. 双击security.enterprise_roots.enabled将其设置为true。

您可以通过将configuration文件部署到计算机来自动执行此操作。

2.部署默认configuration文件

您可以将证书添加到您自己的configuration文件,然后将您的configuration文件的cert8.db文件复制到主程序文件夹。 在计算机上创build的任何新configuration文件都将使用该版本的cert8.db

不幸的是,这对任何已经打开Thunderbird的用户都没有帮助,因为他们的configuration文件已经被创build了。

有关更多信息,请参见https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Thunderbird_Enterprise_Tips#Using_a_private_CA_certificate

3.部署一个configuration文件

如上所述,在选项#1中,Mozilla产品支持在C:\Program Files (possibly x86)\Mozilla Thunderbird\defaults\pref\autoconfig.js部署configuration文件。

您可以在该文件中添加一个脚本,将证书添加到证书存储区。 这是一个例子:

 var cert = "MIIHPT...zTMVD"; // This should be the certificate content with no line breaks at all. var observer = { observe: function observe(aSubject, aTopic, aData) { var certdb = Components.classes["@mozilla.org/security/x509certdb;1"].getService(Components.interfaces.nsIX509CertDB); var certdb2 = certdb; try { certdb2 = Components.classes["@mozilla.org/security/x509certdb;1"].getService(Components.interfaces.nsIX509CertDB2); } catch (e) {} certdb2.addCertFromBase64(cert, "C,C,C", ""); } } Components.utils.import("resource://gre/modules/Services.jsm"); Services.obs.addObserver(observer, "profile-after-change", false); 

4. Mozilla的certutil可执行文件

您可以创build一个运行certutil的login脚本来将证书添加到用户的configuration文件中。 这个论坛post有一个示例脚本(适用于Firefox),其中重要的部分在下面进行了复制(对Thunderbird进行了修改):

 strAppDataDir = WshShell.ExpandEnvironmentStrings("%APPDATA%") strThunderbirdProfilesDir = strAppDataDir & "\Thunderbird\Profiles\" Set arrThunderbirdProfileList = objFSO.GetFolder(strThunderbirdProfilesDir).SubFolders For Each ThunderbirdProfile In arrThunderbirdProfileList 'Create a backup of the old cert8.db file. This line is optional. objFSO.CopyFile ThunderbirdProfile & "\cert8.db" , ThunderbirdProfile & "\cert8.db.old", OverWriteFiles 'Add the local CA certificate to cert8.db and assign appropriate trust levels. Call WshShell.Run(strCertutilPath & " -A -n " & Chr(34) & strLocalCertificateAuthorityName & Chr(34) & " -i " & strCertificateFilePath & " -t " & Chr(34) & strTrustAttributes & Chr(34) & " -d " & Chr(34) & ThunderbirdProfile & Chr(34), 0, true) Next 

(注意:不要将这个与微软的同名程序混淆)

5.您可以使用pipe理工具

CCK2是Mozilla产品的第三方pipe理工具。 请参阅其文档以获取更多详细信