Expand TrustLab certificate failure scenarios

This commit is contained in:
sergeych committed 2026-08-16 16:27:20 +04:00
1 parent 9830f444ac
commit f1fcef9b85
7 files changed
+240 -16

No files matched your search

+25 -1
View File
@@ -57,6 +57,29 @@ export function createVillageCommunityPlugin() {
};
}
export function createCommunityAdvicePlugin({
id,
name,
trusted,
message,
}) {
return {
manifest: { id, name, role: "advisor" },
collectEvidence() {
return {
entries: [
{
kind: "vote",
code: trusted ? "community-votes-trusted" : "community-votes-not-trusted",
message,
data: { trusted },
},
],
};
},
};
}
export function createUserDecisionPlugin(decision) {
if (decision !== true && decision !== false) return undefined;
return {
@@ -84,7 +107,8 @@ function explainValidationError(error) {
expired: "At least one certificate in the validation path is outside its validity period.",
"hostname-mismatch":
"The leaf certificate does not identify the requested hostname.",
"explicitly-distrusted-authority":
"The chain reaches an authority rejected by an explicit local Browsec rule.",
};
return explanations[error] ?? `Firefox reported certificate error: ${error}.`;
}