perf: dcdn自动匹配部署,支持新增域名感知

This commit is contained in:
xiaojunnuo
2026-03-29 01:57:33 +08:00
parent fe02ce7b64
commit c6a988bc92
7 changed files with 204 additions and 94 deletions

View File

@@ -43,6 +43,12 @@ const formats = {
jks: ["jks"],
p7b: ["p7b", "key"],
};
export type SimpleCertDetail = {
notBefore: Date;
notAfter: Date;
domains: string[];
};
export class CertReader {
cert: CertInfo;
@@ -116,6 +122,15 @@ export class CertReader {
return CertReader.readCertDetail(crt);
}
getSimpleDetail() {
const { detail } = this.getCrtDetail();
return {
notBefore: detail.notBefore,
notAfter: detail.notAfter,
domains: this.getAllDomains(),
};
}
static readCertDetail(crt: string) {
const detail = crypto.readCertificateInfo(crt.toString());
const effective = detail.notBefore;