v2
xiaojunnuo 2024-12-17 22:45:14 +08:00
parent 21f50e0b38
commit 0e7578043e
3 changed files with 10 additions and 0 deletions

View File

@ -32,6 +32,7 @@ export type CertInfo = {
pfx?: string;
der?: string;
jks?: string;
one?: string;
};
export type SSLProvider = "letsencrypt" | "google" | "zerossl";
export type PrivateKeyType = "rsa_1024" | "rsa_2048" | "rsa_3072" | "rsa_4096" | "ec_256" | "ec_384" | "ec_521";

View File

@ -192,6 +192,7 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
zip.file("cert.key", cert.key);
zip.file("intermediate.crt", cert.ic);
zip.file("origin.crt", cert.oc);
zip.file("one.pem", cert.one);
if (cert.pfx) {
zip.file("cert.pfx", Buffer.from(cert.pfx, "base64"));
}
@ -209,6 +210,7 @@ cert.crt证书文件包含证书链pem格式
cert.keypem
intermediate.crtpem
origin.crtpem
one.pem pemcrt+key
cert.pfxpfxiis使
cert.derder
cert.jksjksjava使

View File

@ -25,6 +25,7 @@ export class CertReader {
key: string;
csr: string;
ic: string; //中间证书
one: string; //crt + key 合成一个pem文件
detail: any;
expires: number;
@ -46,6 +47,12 @@ export class CertReader {
this.cert.oc = this.oc;
}
this.one = certInfo.one;
if (!this.one) {
this.one = this.crt + "\n" + this.key;
this.cert.one = this.one;
}
const { detail, expires } = this.getCrtDetail(this.cert.crt);
this.detail = detail;
this.expires = expires.getTime();