mirror of https://github.com/certd/certd
fix: 修复阿里云新加坡clb无法部署证书的bug
parent
7c0cdd169e
commit
3e84e116e8
|
@ -153,4 +153,17 @@ export class AliyunSslClient {
|
||||||
async deleteCert(certId: any) {
|
async deleteCert(certId: any) {
|
||||||
await this.doRequest("DeleteUserCertificate", { CertId: certId }, { method: "POST" });
|
await this.doRequest("DeleteUserCertificate", { CertId: certId }, { method: "POST" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCasRegionFromEndpoint(endpoint: string) {
|
||||||
|
/**
|
||||||
|
* {value: 'cas.aliyuncs.com', label: '中国大陆'},
|
||||||
|
* {value: 'cas.ap-southeast-1.aliyuncs.com', label: '新加坡'},
|
||||||
|
* {value: 'cas.eu-central-1.aliyuncs.com', label: '德国(法兰克福)'},
|
||||||
|
*/
|
||||||
|
const region = endpoint.replace(".aliyuncs.com", "").replace("cas.", "");
|
||||||
|
if (region === "cas") {
|
||||||
|
return "cn-hangzhou";
|
||||||
|
}
|
||||||
|
return region;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,10 +229,13 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
async uploadServerCert(client: any, aliyunCert: CasCertInfo) {
|
async uploadServerCert(client: any, aliyunCert: CasCertInfo) {
|
||||||
|
|
||||||
|
const casRegion = client.getCasRegionFromEndpoint(this.casEndpoint);
|
||||||
const params = {
|
const params = {
|
||||||
RegionId: this.regionId,
|
RegionId: this.regionId,
|
||||||
AliCloudCertificateId: aliyunCert.certId,
|
AliCloudCertificateId: aliyunCert.certId,
|
||||||
AliCloudCertificateName: aliyunCert.certName,
|
AliCloudCertificateName: aliyunCert.certName,
|
||||||
|
AliCloudCertificateRegionId: casRegion
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await client.request('UploadServerCertificate', params);
|
const res = await client.request('UploadServerCertificate', params);
|
||||||
|
|
Loading…
Reference in New Issue