fix(backend): улучшить обработку сертификатов и добавить поддержку цепочек сертификатов
This commit is contained in:
1 parent
b51d979a1c
commit
1a47905beb
2 files changed
+27
-13
No files matched your search
@@ -571,21 +571,12 @@ export class MikrotikClient {
|
||||
return this.post("/certificate/import", body, 60_000)
|
||||
}
|
||||
|
||||
async applyCertificateToServices(
|
||||
certName: string,
|
||||
trustStores: string[] = ["www", "api"],
|
||||
): Promise<void> {
|
||||
const stores = trustStores.length > 0 ? trustStores : ["www", "api"]
|
||||
const targets: string[] = []
|
||||
if (stores.includes("www")) targets.push("www-ssl")
|
||||
if (stores.includes("api")) targets.push("api-ssl")
|
||||
if (targets.length === 0) targets.push("www-ssl")
|
||||
|
||||
async applyCertificateToServices(certName: string): Promise<void> {
|
||||
const body = {
|
||||
disabled: "no",
|
||||
certificate: certName,
|
||||
}
|
||||
for (const serviceName of targets) {
|
||||
for (const serviceName of ["www-ssl", "api-ssl"]) {
|
||||
await this.patchIpService(serviceName, body)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user