bug 1347217 - lessen debug spew in deployment-checker r?felipe
MozReview-Commit-ID: JWdnTMr8IaO
--- a/browser/extensions/deployment-checker/bootstrap.js
+++ b/browser/extensions/deployment-checker/bootstrap.js
@@ -40,17 +40,17 @@ class CertificateVerificationResult {
}
verifyCertFinished(aPRErrorCode, aVerifiedChain, aEVStatus) {
let result = { hostname: this.hostname };
if (aPRErrorCode == 0) {
result.chain = certListToJSArray(aVerifiedChain);
} else {
result.error = "certificate reverification";
- console.log(`${this.hostname}: ${aPRErrorCode}`);
+ Services.console.logStringMessage(`${this.hostname}: ${aPRErrorCode}`);
}
this.resolve(result);
}
}
function makeRequest(hostname) {
return new Promise((resolve) => {
let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
@@ -188,25 +188,26 @@ function makeRequests() {
for (let hostname of Object.keys(sites)) {
promises.push(makeRequest(hostname));
}
return Promise.all(promises);
}
function analyzeAndReport(results) {
let payload = { version: "1.0", mismatches: [] };
+ Services.console.logStringMessage("deployment-checker results:");
for (let result of results) {
// Skip if the connection resulted in any kind of error.
if ("error" in result) {
- console.log(`${result.hostname}: ${result.error} - skipping`);
+ Services.console.logStringMessage(`${result.hostname}: ${result.error} - skipping`);
continue;
}
// Skip imported roots.
if (!result.chain[result.chain.length - 1].isBuiltInRoot) {
- console.log(`${result.hostname}: imported root - skipping`);
+ Services.console.logStringMessage(`${result.hostname}: imported root - skipping`);
continue;
}
let report = false;
let expectedHashes = sites[result.hostname];
// If we have chains of different length, obviously we'll have different
// chains, so report this chain.
if (expectedHashes.length != result.chain.length) {
@@ -221,22 +222,20 @@ function analyzeAndReport(results) {
report = true;
break;
}
}
}
if (report) {
payload.mismatches.push({ hostname: result.hostname,
chain: certArrayToBase64(result.chain) });
+ } else {
+ Services.console.logStringMessage(`${result.hostname} sends expected certificate chain`);
}
}
- console.log("deployment-checker results:");
- console.log(results);
- console.log("deployment-checker payload:");
- console.log(payload);
return TelemetryController.submitExternalPing("deployment-checker", payload,
{});
}
// We only run once - when installed.
function install() {
// Only run if we have a good indication that we're not in a testing
// environment (in which case attempting to connect to telemetry.mozilla.org