Skip to content

Commit 9c173c0

Browse files
authored
fix(apisix): transform client TLS certificate pairs when dump upstream (#395)
1 parent 2e14e5a commit 9c173c0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

libs/backend-apisix/src/transformer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ export class ToADC {
222222
tls: upstream.tls
223223
? {
224224
client_cert_id: upstream.tls.client_cert_id,
225-
cert: upstream.tls.client_cert,
226-
key: upstream.tls.client_key,
225+
client_cert: upstream.tls.client_cert,
226+
client_key: upstream.tls.client_key,
227227
verify: upstream.tls.verify,
228228
}
229229
: undefined,

libs/sdk/src/core/schema.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ const upstreamSchema = (extend?: ZodRawShape) =>
163163
client_cert_id: z.string().optional(),
164164
verify: z.boolean().optional(),
165165
})
166-
.refine(
167-
(data) => data.client_cert || data.client_key,
168-
'Please replace `client_cert` and `client_key` with SSL resources and `client_cert_id`.',
169-
)
170166
.optional(),
171167
keepalive_pool: z
172168
.strictObject({

0 commit comments

Comments
 (0)