diff --git a/browser/actors/NetErrorChild.jsm b/browser/actors/NetErrorChild.jsm index 21354e65f3bd..9aa4ccde2483 100644 --- a/browser/actors/NetErrorChild.jsm +++ b/browser/actors/NetErrorChild.jsm @@ -59,6 +59,10 @@ const PREF_SERVICES_SETTINGS_LAST_FETCHED = "services.settings.last_update const PREF_SSL_IMPACT_ROOTS = ["security.tls.version.", "security.ssl3."]; +let formatter = new Services.intl.DateTimeFormat(undefined, { + dateStyle: "long", +}); + function getSerializedSecurityInfo(docShell) { let serhelper = Cc["@mozilla.org/network/serialization-helper;1"] .getService(Ci.nsISerializationHelper); @@ -273,23 +277,25 @@ class NetErrorChild extends ActorChild { if (input.data.isNotValidAtThisTime) { let nowTime = new Date().getTime() * 1000; let msg = ""; + let notAfterLocalTime = formatter.format(new Date(input.data.validity.notAfterLocalTime)); if (input.data.validity.notBefore) { + let notBeforeLocalTime = formatter.format(new Date(input.data.validity.notBeforeLocalTime)); if (nowTime > input.data.validity.notAfter) { technicalInfo.textContent = ""; - msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow2", - [hostString], 1); + msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow3", + [hostString, notAfterLocalTime], 2); msg += "\n"; } else { technicalInfo.textContent = ""; - msg += gPipNSSBundle.formatStringFromName("certErrorNotYetValidNow2", - [hostString], 1); + msg += gPipNSSBundle.formatStringFromName("certErrorNotYetValidNow3", + [hostString, notBeforeLocalTime], 2); msg += "\n"; } } else { // If something goes wrong, we assume the cert expired. technicalInfo.textContent = ""; - msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow2", - [hostString], 1); + msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow3", + [hostString, notAfterLocalTime], 2); msg += "\n"; } technicalInfo.append(msg); @@ -480,9 +486,6 @@ class NetErrorChild extends ActorChild { let now = Date.now(); let certRange = this._getCertValidityRange(docShell); - let formatter = new Services.intl.DateTimeFormat(undefined, { - dateStyle: "short", - }); let approximateDate = now - difference * 1000; // If the difference is more than a day, we last fetched the date in the last 5 days, diff --git a/browser/base/content/test/about/browser_aboutCertError_clockSkew.js b/browser/base/content/test/about/browser_aboutCertError_clockSkew.js index bb69ba0b440e..5e38cd19605e 100644 --- a/browser/base/content/test/about/browser_aboutCertError_clockSkew.js +++ b/browser/base/content/test/about/browser_aboutCertError_clockSkew.js @@ -41,7 +41,7 @@ add_task(async function checkWrongSystemTimeWarning() { Services.prefs.setIntPref(PREF_SERVICES_SETTINGS_LAST_FETCHED, Math.floor(Date.now() / 1000)); let formatter = new Services.intl.DateTimeFormat(undefined, { - dateStyle: "short", + dateStyle: "long", }); // For this test, we want to trick Firefox into believing that diff --git a/security/manager/locales/en-US/chrome/pipnss/pipnss.properties b/security/manager/locales/en-US/chrome/pipnss/pipnss.properties index 556fc0ca693c..65f5eeaa1e3e 100755 --- a/security/manager/locales/en-US/chrome/pipnss/pipnss.properties +++ b/security/manager/locales/en-US/chrome/pipnss/pipnss.properties @@ -285,11 +285,11 @@ certErrorMismatchMultiple3=Websites prove their identity via certificates. %1$S # LOCALIZATION NOTE (certErrorExpiredNow): Do not translate %1$S (date+time of expired certificate) or %2$S (current date+time) certErrorExpiredNow=The certificate expired on %1$S. The current time is %2$S. -certErrorExpiredNow2=Websites prove their identity via certificates, which are valid for a set time period. The certificate for %S appears to be expired. +certErrorExpiredNow3=Websites prove their identity via certificates, which are valid for a set time period. The certificate for %1$S expired on %2$S. # LOCALIZATION NOTE (certErrorNotYetValidNow): Do not translate %1$S (date+time certificate will become valid) or %2$S (current date+time) certErrorNotYetValidNow=The certificate will not be valid until %1$S. The current time is %2$S. -certErrorNotYetValidNow2=Websites prove their identity via certificates, which are valid for a set time period. The certificate for %S appears to be not yet valid. +certErrorNotYetValidNow3=Websites prove their identity via certificates, which are valid for a set time period. The certificate for %1$S will not be valid until %2$S. certErrorMitM=Websites prove their identity via certificates, which are issued by certificate authorities. # LOCALIZATION NOTE (certErrorMitM2): %S is brandShortName