mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
perf: 支持部署到nginx-proxy-manager
This commit is contained in:
@@ -135,7 +135,12 @@ export class CertReader {
|
||||
}
|
||||
|
||||
static readCertDetail(crt: string) {
|
||||
const detail = crypto.readCertificateInfo(crt.toString());
|
||||
let detail: CertificateInfo;
|
||||
try {
|
||||
detail = crypto.readCertificateInfo(crt.toString());
|
||||
} catch (e) {
|
||||
throw new Error("证书解析失败:" + e.message + "(请确定证书格式,是否与私钥搞反?)");
|
||||
}
|
||||
const effective = detail.notBefore;
|
||||
const expires = detail.notAfter;
|
||||
const fingerprints = CertReader.getFingerprintX509(crt);
|
||||
|
||||
Reference in New Issue
Block a user