Skip to content

Commit

Permalink
Fix: Manually calculate SHA256 to support node v14
Browse files Browse the repository at this point in the history
  • Loading branch information
chakflying authored and louislam committed Oct 15, 2023
1 parent 40367ba commit b7f837f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/util-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,10 @@ module.exports.rootCertificatesFingerprints = () => {
let certBody = certLines.join("");
let buf = Buffer.from(certBody, "base64");

let certDocoded = new crypto.X509Certificate(buf);
return certDocoded.fingerprint256;
const shasum = crypto.createHash("sha256");
shasum.update(buf);

return shasum.digest("hex").toUpperCase().replace(/(.{2})(?!$)/g, "$1:");
});

fingerprints.push("6D:99:FB:26:5E:B1:C5:B3:74:47:65:FC:BC:64:8F:3C:D8:E1:BF:FA:FD:C4:C2:F9:9B:9D:47:CF:7F:F1:C2:4F"); // ISRG X1 cross-signed with DST X3
Expand Down

0 comments on commit b7f837f

Please sign in to comment.