tzssangglass commented on code in PR #7540:
URL: https://github.com/apache/apisix/pull/7540#discussion_r930700479


##########
docs/en/latest/certificate.md:
##########
@@ -171,3 +171,134 @@ private keys by `certs` and `keys`.
 
 `APISIX` will pair certificate and private key with the same indice as a SSL 
key
 pair. So the length of `certs` and `keys` must be same.
+
+### set up multiple CA certificates
+
+APISIX currently uses CA certificates in several places, such as [Protect 
Admin API](./mtls.md#protect-admin-api), [etcd with 
mTLS](./mtls.md#etcd-with-mtls), and [Deployment 
Modes](./architecture-design/deployment-role.md).
+
+In these places, `ssl_trusted_certificate` or `trusted_ca_cert` will be used 
to set up the CA certificate, but these configurations will eventually be 
translated into 
[lua_ssl_trusted_certificate](https://github.com/openresty/lua-nginx-module#lua_ssl_trusted_certificate)
 directive in OpenResty.
+
+If you need to set up different CA certificates in different places, then you 
can package these CA certificates into a CA bundle file and point to this file 
when you need to set up CAs. This will avoid the problem that the generated 
`lua_ssl_trusted_certificate` has multiple locations and overwrites each other.
+
+The following is a complete example to show how to set up multiple CA 
certificates in APISXI.

Review Comment:
   done



##########
docs/zh/latest/certificate.md:
##########
@@ -168,3 +168,133 @@ curl --resolve 'www.test.com:9443:127.0.0.1' 
https://www.test.com:9443/hello  -v
 * `keys`:PEM 格式的 SSL 证书私钥列表
 
 `APISIX` 会将相同下标的证书和私钥配对使用,因此 `certs` 和 `keys` 列表的长度必须一致。
+
+### 设置多个 CA 证书
+
+APISIX 目前支持在多处设置 CA 证书,比如 [保护 Admin API](./mtls.md#保护-admin-api),[保护 
ETCD](./mtls.md#保护-etcd),以及 
[部署模式](../../en/latest/architecture-design/deployment-role.md) 等。
+
+在这些地方,使用 `ssl_trusted_certificate` 或 `trusted_ca_cert` 来配置 CA 证书,但是这些配置最终将转化为 
OpenResty 的 
[lua_ssl_trusted_certificate](https://github.com/openresty/lua-nginx-module#lua_ssl_trusted_certificate)
 指令。
+
+如果你需要在不同的地方指定不同的 CA 证书,你可以将这些 CA 证书制作成一个 CA bundle 文件,在需要用到 CA 
证书的地方将配置指向这个文件。这样可以避免生成的 `lua_ssl_trusted_certificate` 存在多处并且互相覆盖的问题。
+
+下面用一个完整的例子来展示如何在 APISXI 设置多个 CA 证书。
+
+假设让 Client 与 APISIX Admin API,APISXI 与 ETCD 之间都使用 mTLS 协议进行通信,目前有两张 CA 证书,分别是 
`foo_ca.crt` 和 `bar_ca.crt`,用这两张 CA 证书各自签发 client 与 server 证书对,`foo_ca.crt` 
及其签发的证书对用于保护 Admin API,`bar_ca.crt` 及其签发的证书对用于保护 ETCD。

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to