diff --git a/browser/root-certs b/browser/root-certs index 6c57965..54038f3 100755 --- a/browser/root-certs +++ b/browser/root-certs @@ -50,14 +50,14 @@ function getRootCerts(callback) { + ' pem = pem.replace(/-----BEGIN CERTIFICATE-----/g, "");\n' + ' pem = pem.replace(/-----END CERTIFICATE-----/g, "");\n' + ' pem = pem.replace(/\\s+/g, "");\n' - + ' if (!Object.prototype.hasOwnProperty.call(certs, pem)) return;\n' - + ' return certs[pem];\n' + + ' if (!Object.prototype.hasOwnProperty.call(trusted, pem)) return;\n' + + ' return trusted[pem];\n' + '}\n' + '\n' + 'function getCert(name) {\n' + ' name = name.replace(/^\s+|\s+$/g, "");\n' - + ' if (!Object.prototype.hasOwnProperty.call(trusted, name)) return;\n' - + ' return trusted[name];\n' + + ' if (!Object.prototype.hasOwnProperty.call(certs, name)) return;\n' + + ' return certs[name];\n' + '}\n' + '\n' + 'exports.certs = certs;\n' diff --git a/lib/common/RootCerts.js b/lib/common/RootCerts.js index 5c5629e..71501d4 100644 --- a/lib/common/RootCerts.js +++ b/lib/common/RootCerts.js @@ -3719,14 +3719,14 @@ function getTrusted(pem) { pem = pem.replace(/-----BEGIN CERTIFICATE-----/g, ""); pem = pem.replace(/-----END CERTIFICATE-----/g, ""); pem = pem.replace(/\s+/g, ""); - if (!Object.prototype.hasOwnProperty.call(certs, pem)) return; - return certs[pem]; + if (!Object.prototype.hasOwnProperty.call(trusted, pem)) return; + return trusted[pem]; } function getCert(name) { name = name.replace(/^s+|s+$/g, ""); - if (!Object.prototype.hasOwnProperty.call(trusted, name)) return; - return trusted[name]; + if (!Object.prototype.hasOwnProperty.call(certs, name)) return; + return certs[name]; } exports.certs = certs;