You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/enable-tls-for-mysql-client.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -639,6 +639,10 @@ In this step, you create a TiDB cluster and perform the following operations:
639
639
640
640
## Step 3. Configure the MySQL client to use a TLS connection
641
641
642
+
>**Note:**
643
+
>
644
+
> By default, the server does not validate the client certificate. To require client certificate validation, use [`ALTER USER`](https://docs.pingcap.com/tidb/stable/sql-statement-alter-user/) to configure the account with `REQUIRE X509` or other client certificate constraints.
645
+
642
646
To connect the MySQL client with the TiDB cluster, use the client-side certificate created above and take the following methods. For details, refer to [Configure the MySQL client to use encrypted connections](https://docs.pingcap.com/tidb/stable/enable-tls-between-clients-and-servers#configure-the-mysql-client-to-use-encrypted-connections).
643
647
644
648
Execute the following command to acquire the client-side certificate and connect to the TiDB server:
@@ -724,3 +728,28 @@ SHOW GLOBAL STATUS LIKE 'Ssl\_server\_not\_%';
When you use TiProxy in front of multiple TiDB servers, you also need to configure TLS for TiProxy. The certificate layout depends on the `TiProxyCertLayout` setting:
735
+
736
+
- Not set: uses the legacy layout.
737
+
- `v1`: uses version one of the layout (recommended).
738
+
739
+
The following are the TLS settings for each TiProxy component:
740
+
741
+
- `security.cluster-tls`: used forcommunication between TiProxy and other componentsin the cluster, functioning as both client and server using mutual TLS (mTLS).
742
+
- `security.server-tls`: used to provide MySQL protocol access on port `6000`.
743
+
- `security.sql-tls`: used for TiProxy to access the SQL port of TiDB.
744
+
- `security.server-http-tls`: used to provide HTTP service on port `3080`.
745
+
746
+
For more information, see [the security section of TiProxy configuration file](https://docs.pingcap.com/tidb/stable/tiproxy-configuration/#security).
747
+
748
+
By default, TiProxy attempts to reuse the TiDB TLS secret for both client and server connections. If you use this behavior, ensure that the certificates include the hostnames of the TiProxy nodes.
749
+
750
+
The following settings also affect TLS behavior:
751
+
752
+
- `tlsCluster.enabled`
753
+
- `tlsClient.enabled`
754
+
755
+
You can generate certificates using tools such as `cfssl` or `cert-manager`.
0 commit comments