Skip to content

Commit dd189e0

Browse files
authored
security: add steps to validate TLS between components (#20986)
1 parent 936a672 commit dd189e0

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

enable-tls-between-components.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ aliases: ['/docs-cn/dev/enable-tls-between-components/','/docs-cn/dev/how-to/sec
154154
> **注意:**
155155
>
156156
> - 从 v8.4.0 起,PD 的 `cert-allowed-cn` 配置项支持设置多个值。你可以根据需要在 TiDB 的 `cluster-verify-cn` 配置项以及其它组件的 `cert-allowed-cn` 配置项中设置多个 `Common Name`。需要额外注意的是,TiUP 在查询组件状态的时候会使用独立的标识,比如集群名是 `test`,它会使用 `test-client` 作为 `Common Name`。
157-
> - 对于 v8.3.0 及之前版本,PD 的 `cert-allowed-cn` 配置项只能设置一个值。因此,所有认证对象的 `Common Name` 必须设置成同一个值。相关配置示例可参见 [v8.3.0 文档](https://docs.pingcap.com/zh/tidb/v8.3/enable-tls-between-components)。
157+
> - 对于 v8.3.0 及之前版本,PD 的 `cert-allowed-cn` 配置项只能设置一个值。因此,所有认证对象的 `Common Name` 必须设置成同一个值。相关配置示例可参见 [v8.3.0 文档](https://docs-archive.pingcap.com/tidb/v8.3/enable-tls-between-components/)。
158158

159159
- TiDB
160160

@@ -209,6 +209,40 @@ aliases: ['/docs-cn/dev/enable-tls-between-components/','/docs-cn/dev/how-to/sec
209209
cert-allowed-cn = ["tiproxy", "tidb", "test-client", "prometheus"]
210210
```
211211

212+
## 验证 TiDB 组件间的 TLS 配置
213+
214+
在为 TiDB 组件间通信配置 TLS 后,可以使用以下命令验证 TLS 是否已成功启用。这些命令会输出每个组件的证书和 TLS 握手详细信息。
215+
216+
- TiDB
217+
218+
```sh
219+
openssl s_client -connect <tidb_host>:10080 -cert /path/to/client.pem -key /path/to/client-key.pem -CAfile ./ca.crt < /dev/null
220+
```
221+
222+
- PD
223+
224+
```sh
225+
openssl s_client -connect <pd_host>:2379 -cert /path/to/client.pem -key /path/to/client-key.pem -CAfile ./ca.crt < /dev/null
226+
```
227+
228+
- TiKV
229+
230+
```sh
231+
openssl s_client -connect <tikv_host>:20160 -cert /path/to/client.pem -key /path/to/client-key.pem -CAfile ./ca.crt < /dev/null
232+
```
233+
234+
- TiFlash (在 v4.0.5 版本引入)
235+
236+
```sh
237+
openssl s_client -connect <tiflash_host>:<tiflash_port> -cert /path/to/client.pem -key /path/to/client-key.pem -CAfile ./ca.crt < /dev/null
238+
```
239+
240+
- TiProxy
241+
242+
```sh
243+
openssl s_client -connect <tiproxy_host>:3080 -cert /path/to/client.pem -key /path/to/client-key.pem -CAfile ./ca.crt < /dev/null
244+
```
245+
212246
## 证书重新加载
213247

214248
- 如果 TiDB 集群部署在本地的数据中心,TiDB、PD、TiKV、TiFlash、TiCDC、TiProxy 和各种 client 在每次新建相互通讯的连接时都会重新读取当前的证书和密钥文件内容,实现证书和密钥的重新加载,无需重启 TiDB 集群。

0 commit comments

Comments
 (0)