Bug 1334774 - re-introduce the hostname into ssl error messages, r=nhnt11
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Sun, 29 Jan 2017 17:36:01 +0100
changeset 331964 9d5eba009db70655cd8dd142e3fe4d02e2d8d07f
parent 331908 ae91b2b5bb69ffd18b4679188730d0c6af3b4a95
child 331965 265a8f035aded631fc9826a1352d7b253310171c
push id31293
push userkwierso@gmail.com
push dateThu, 02 Feb 2017 00:07:12 +0000
treeherdermozilla-central@8196774c6b8a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnhnt11
bugs1334774
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1334774 - re-introduce the hostname into ssl error messages, r=nhnt11 MozReview-Commit-ID: CexcCq5qo1v
browser/base/content/aboutNetError.xhtml
browser/base/content/test/general/browser_aboutCertError.js
--- a/browser/base/content/aboutNetError.xhtml
+++ b/browser/base/content/aboutNetError.xhtml
@@ -346,16 +346,19 @@
         window.addEventListener("AboutNetErrorCaptivePortalFreed", () => {
           document.location.reload();
         });
       }
 
       function initPageCertError() {
         document.body.className = "certerror";
         document.title = document.getElementById("certErrorPageTitle").textContent;
+        for (let host of document.querySelectorAll(".hostname")) {
+          host.textContent = document.location.hostname;
+        }
 
         setupAdvancedButton(true);
 
         document.getElementById("learnMoreContainer").style.display = "block";
 
         let checkbox = document.getElementById("automaticallyReportInFuture");
         checkbox.addEventListener("change", function({target: {checked}}) {
           document.dispatchEvent(new CustomEvent("AboutNetErrorSetAutomatic", {
--- a/browser/base/content/test/general/browser_aboutCertError.js
+++ b/browser/base/content/test/general/browser_aboutCertError.js
@@ -212,30 +212,35 @@ add_task(function* checkWrongSystemTimeW
   message = yield Task.spawn(setUpPage);
 
   is(message.divDisplay, "none", "Wrong time message information is not visible");
 
   yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(function* checkAdvancedDetails() {
-  info("Loading a bad cert page and verifying the advanced details section");
+  info("Loading a bad cert page and verifying the main error and advanced details section");
   let browser;
   let certErrorLoaded;
   yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
     gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
     browser = gBrowser.selectedBrowser;
     certErrorLoaded = waitForCertErrorLoad(browser);
   }, false);
 
   info("Loading and waiting for the cert error");
   yield certErrorLoaded;
 
   let message = yield ContentTask.spawn(browser, null, function* () {
     let doc = content.document;
+    let shortDescText = doc.getElementById("errorShortDescText");
+    info("Main error text: " + shortDescText.textContent);
+    ok(shortDescText.textContent.includes("expired.example.com"),
+       "Should list hostname in error message.");
+
     let advancedButton = doc.getElementById("advancedButton");
     advancedButton.click();
     let el = doc.getElementById("errorCode");
     return { textContent: el.textContent, tagName: el.tagName };
   });
   is(message.textContent, "SEC_ERROR_EXPIRED_CERTIFICATE",
      "Correct error message found");
   is(message.tagName, "a", "Error message is a link");