mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Only SSL CA certs
This commit is contained in:
parent
524331d232
commit
090dd9369f
7 changed files with 2763 additions and 6872 deletions
|
@ -33,6 +33,7 @@ function getPEMString(cert)
|
|||
}
|
||||
|
||||
let certcache = Components.classes["@mozilla.org/security/nsscertcache;1"].createInstance(Ci.nsINSSCertCache);
|
||||
let certdb = Components.classes["@mozilla.org/security/x509certdb;1"].createInstance(Ci.nsIX509CertDB);
|
||||
certcache.cacheAllCerts();
|
||||
let enumerator = certcache.getX509CachedCerts().getEnumerator();
|
||||
let certlist = [];
|
||||
|
@ -40,8 +41,11 @@ let certstring="";
|
|||
while(enumerator.hasMoreElements()){
|
||||
let cert = enumerator.getNext().QueryInterface(Ci.nsIX509Cert);
|
||||
let pem = getPEMString(cert);
|
||||
certlist.push({name: cert.commonName, pem: pem});
|
||||
certstring+=pem;
|
||||
let trusted = certdb.isCertTrusted(cert, Ci.nsIX509Cert.CA_CERT, Ci.nsIX509CertDB.TRUSTED_SSL);
|
||||
certlist.push({name: cert.commonName, pem: pem, trusted: trusted});
|
||||
if (trusted) {
|
||||
certstring+=pem;
|
||||
}
|
||||
}
|
||||
|
||||
function save(path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue