源码快照 @ 2026-09-02 (source-only, 剔除非源码素材)

This commit is contained in:
agent-radar
2026-09-02 01:05:41 +08:00
commit 04bac1f6e2
2200 changed files with 489415 additions and 0 deletions
@@ -0,0 +1,33 @@
const { X509Certificate } = require("node:crypto");
const tls = require("node:tls");
const needle = (process.env.OPENWORK_TLS_REPRO_CA_MATCH || "OpenWork TLS Repro").toLowerCase();
function countMatchingSubjects(certificates) {
let count = 0;
for (const pem of certificates) {
try {
const certificate = new X509Certificate(pem);
if (certificate.subject.toLowerCase().includes(needle)) count += 1;
} catch {
// Ignore entries that are not parseable X.509 certificates.
}
}
return count;
}
const system = tls.getCACertificates("system");
const bundled = tls.getCACertificates("default");
const result = {
systemCount: system.length,
reproInSystem: countMatchingSubjects(system),
defaultCount: bundled.length,
reproInDefault: countMatchingSubjects(bundled),
};
console.log(JSON.stringify(result, null, 2));
if (result.reproInSystem === 0) {
process.exitCode = 1;
}