mirror of
https://github.com/certd/certd.git
synced 2026-05-01 02:17:27 +08:00
chore: 清理过期证书增加日志打印
This commit is contained in:
@@ -236,6 +236,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
|
|||||||
|
|
||||||
const certIds = [];
|
const certIds = [];
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
|
this.logger.info(`监听器${listener}绑定的证书${item.CertificateId},status:${item.Status},IsDefault:${item.IsDefault}`);
|
||||||
if (item.Status !== "Associated") {
|
if (item.Status !== "Associated") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -244,10 +245,12 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
|
|||||||
}
|
}
|
||||||
certIds.push( parseInt(item.CertificateId));
|
certIds.push( parseInt(item.CertificateId));
|
||||||
}
|
}
|
||||||
|
this.logger.info(`监听器${listener}绑定的证书${certIds}`);
|
||||||
//检查是否过期,过期则删除
|
//检查是否过期,过期则删除
|
||||||
const invalidCertIds = [];
|
const invalidCertIds = [];
|
||||||
for (const certId of certIds) {
|
for (const certId of certIds) {
|
||||||
const res = await sslClient.getCertInfo(certId);
|
const res = await sslClient.getCertInfo(certId);
|
||||||
|
this.logger.info(`证书${certId}过期时间:${res.notAfter}`);
|
||||||
if (res.notAfter < new Date().getTime()) {
|
if (res.notAfter < new Date().getTime()) {
|
||||||
invalidCertIds.push(certId);
|
invalidCertIds.push(certId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user