This commit is contained in:
xiaojunnuo
2025-05-26 22:44:56 +08:00
parent e08cf57b72
commit 86e521b9aa
7 changed files with 37 additions and 13 deletions

View File

@@ -83,7 +83,7 @@ export class AliyunSslClient {
method: "POST",
};
this.opts.logger.info("开始上传证书");
this.opts.logger.info(`开始上传证书${req.name}`);
const ret: any = await client.request("UploadUserCertificate", params, requestOption);
this.checkRet(ret);
this.opts.logger.info("证书上传成功aliyunCertId=", ret.CertId);

View File

@@ -50,9 +50,22 @@ export class TencentSslClient {
const ret = await client.UploadCertificate(params);
this.checkRet(ret);
this.logger.info("证书上传成功tencentCertId=", ret.CertificateId);
await this.switchCertNotify([ret.CertificateId], true);
return ret.CertificateId;
}
async switchCertNotify(certIds: string[], disabled: boolean) {
const client = await this.getSslClient();
const params = {
CertificateIds: certIds,
SwitchStatus: disabled ? 1 : 0, //1是忽略通知0是不忽略
};
const ret = await client.ModifyCertificatesExpiringNotificationSwitch(params);
this.checkRet(ret);
this.logger.info(`关闭证书${certIds}过期通知成功`);
return ret.RequestId;
}
async deployCertificateInstance(params: any) {
const client = await this.getSslClient();
const res = await client.DeployCertificateInstance(params);