perf: 优化阿里云nlb支持部署扩展证书

This commit is contained in:
xiaojunnuo
2025-06-09 23:41:44 +08:00
parent c1fbc8cd68
commit 9cbdfda829
3 changed files with 183 additions and 33 deletions

View File

@@ -29,7 +29,7 @@ export type AliyunSslUploadCertReq = {
cert: AliyunCertInfo;
};
export type CasCertInfo = { certId: number; certName: string; certIdentifier: string; notAfter: number };
export type CasCertInfo = { certId: number; certName: string; certIdentifier: string; notAfter: number; casRegion: string };
export class AliyunSslClient {
opts: AliyunSslClientOpts;
@@ -69,6 +69,7 @@ export class AliyunSslClient {
certName: res.Name,
certIdentifier: res.CertIdentifier,
notAfter: res.NotAfter,
casRegion: this.getCasRegionFromEndpoint(this.opts.endpoint),
};
}
@@ -155,6 +156,9 @@ export class AliyunSslClient {
}
getCasRegionFromEndpoint(endpoint: string) {
if (!endpoint) {
return "cn-hangzhou";
}
/**
* {value: 'cas.aliyuncs.com', label: '中国大陆'},
* {value: 'cas.ap-southeast-1.aliyuncs.com', label: '新加坡'},