我们刚刚开始使用Thunderbird自动configuration,并发现它为每个启动邮件客户端的用户自动创build公司标准的imap,smtp和ldap帐户非常有用。
但是 ,公司ldap服务器(实际上是一个Windows域控制器)使用我们公司authentication机构颁发的证书,这当然不被Thunderbird信任。 因此,直到ca证书被手动导入和信任,ldap远程地址簿才会同步。
亲爱的thunderbird.cfg可以用来导入和信任ca根吗?
我们已经尝试了以下两种解决scheme ,他们显然没有做任何事情:也许他们只用于Firefox,或者我们没有正确configuration。
试图信任Windows操作系统所信任的ca根:
pref("security.enterprise_roots.enabled, true");
试图导入和信任ca根证书:
var Cc = Components.classes; var Ci = Components.interfaces; var certdb = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB); var certdb2 = certdb; try { certdb2 = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB2); } catch (e) {} // This should be the certificate content with no line breaks at all. cert = "MII ... =="; certdb.addCertFromBase64(cert, "C,C,C");
更新和解决scheme。
我们找不到方法1. ,但最后用方法2.成功了2.错误是我对这句话的明显误解:
第三个参数已经从API中删除,不应该包含在内
我认为addCertFromBase64只需要两个参数,而它仍然需要第三个参数,即使它只是一个空白string。 编辑命令到certdb.addCertFromBase64(cert, "C,C,C",""); 做了工作。
至于方法2. ,缺less一个参数。 下面的代码工作(见最后一行):
var Cc = Components.classes; var Ci = Components.interfaces; var certdb = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB); var certdb2 = certdb; try { certdb2 = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB2); } catch (e) {} // This should be the certificate content with no line breaks at all. cert = "MII ... =="; certdb.addCertFromBase64(cert, "C,C,C","");