|
|
@ -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' |
|
|
|