Bug 1231312 Simplify the string in browser.properties about certificate errors sent to website owners. r=past

This commit is contained in:
Tyler Steiman 2016-01-07 14:02:44 +02:00 committed by Panos Astithas
parent 7702c52755
commit 23ffca4d0f
2 changed files with 24 additions and 14 deletions

View File

@ -3121,8 +3121,7 @@ function getDetailedCertErrorInfo(location, securityInfoAsString) {
if (!securityInfoAsString)
return "";
let details = [];
details.push(location);
let certErrorDetails = location;
const serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
.getService(Ci.nsISerializationHelper);
@ -3132,7 +3131,7 @@ function getDetailedCertErrorInfo(location, securityInfoAsString) {
let errors = Cc["@mozilla.org/nss_errors_service;1"]
.getService(Ci.nsINSSErrorsService);
let code = securityInfo.errorCode;
details.push(errors.getErrorMessage(errors.getXPCOMFromNSSError(code)));
certErrorDetails += "\r\n\r\n" + errors.getErrorMessage(errors.getXPCOMFromNSSError(code));
const sss = Cc["@mozilla.org/ssservice;1"]
.getService(Ci.nsISiteSecurityService);
@ -3143,8 +3142,15 @@ function getDetailedCertErrorInfo(location, securityInfoAsString) {
Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0;
let uri = Services.io.newURI(location, null, null);
details.push(sss.isSecureHost(sss.HEADER_HSTS, uri.host, flags));
details.push(sss.isSecureHost(sss.HEADER_HPKP, uri.host, flags));
let hasHSTS = sss.isSecureHost(sss.HEADER_HSTS, uri.host, flags);
let hasHPKP = sss.isSecureHost(sss.HEADER_HPKP, uri.host, flags);
certErrorDetails += "\r\n\r\n" +
gNavigatorBundle.getFormattedString("certErrorDetailsHSTS.label",
[hasHSTS]);
certErrorDetails += "\r\n" +
gNavigatorBundle.getFormattedString("certErrorDetailsKeyPinning.label",
[hasHPKP]);
let certChain = "";
if (securityInfo.failedCertChain) {
@ -3155,8 +3161,12 @@ function getDetailedCertErrorInfo(location, securityInfoAsString) {
certChain += getPEMString(cert);
}
}
details.push(certChain);
return gNavigatorBundle.getFormattedString("certErrorDetails.label", details, 5);
certErrorDetails += "\r\n\r\n" +
gNavigatorBundle.getString("certErrorDetailsCertChain.label") +
"\r\n\r\n" + certChain;
return certErrorDetails;
}
// TODO: can we pull getDERString and getPEMString in from pippki.js instead of

View File

@ -799,13 +799,13 @@ unmuteTab.accesskey = M
weakCryptoOverriding.message = %S recommends that you don't enter your password, credit card and other personal information on this website.
revokeOverride.label = Don't Trust This Website
revokeOverride.accesskey = D
# LOCALIZATION NOTE (certErrorDetails.label): This is a text string that
# appears in the about:certerror page, so that the user can copy and send it to
# the server administrators for troubleshooting. %1$S is the visited URL, %2$S
# is the error message, %3$S is true or false, depending on whether the server
# supports HSTS, %4$S is true or false, depending on whether the server
# supports HPKP, %5$S is the certificate chain in PEM format.
certErrorDetails.label = %1$S\r\n\r\n%2$S\r\n\r\nHTTP Strict Transport Security: %3$S\r\nHTTP Public Key Pinning: %4$S\r\n\r\nCertificate chain:\r\n\r\n%5$S
# LOCALIZATION NOTE (certErrorDetails*.label): These are text strings that
# appear in the about:certerror page, so that the user can copy and send them to
# the server administrators for troubleshooting.
certErrorDetailsHSTS.label = HTTP Strict Transport Security: %S
certErrorDetailsKeyPinning.label = HTTP Public Key Pinning: %S
certErrorDetailsCertChain.label = Certificate chain:
# LOCALIZATION NOTE (tabgroups.migration.anonGroup):
# %S is the group number/ID