From 90daeb58b7f79a9840e6d3eddb2a70e8e11dc6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 26 Sep 2025 15:09:40 +0200 Subject: [PATCH 1/2] enable-tls-between-clients-and-servers: add TiProxy --- enable-tls-between-clients-and-servers.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/enable-tls-between-clients-and-servers.md b/enable-tls-between-clients-and-servers.md index 3e47532a9bb88..6b5603ebc3dfc 100644 --- a/enable-tls-between-clients-and-servers.md +++ b/enable-tls-between-clients-and-servers.md @@ -21,9 +21,7 @@ To use connections secured with TLS, you first need to configure the TiDB server Similar to MySQL, TiDB allows TLS and non-TLS connections on the same TCP port. For a TiDB server with TLS enabled, you can choose to securely connect to the TiDB server through an encrypted connection, or to use an unencrypted connection. You can use the following ways to require the use of secure connections: + Configure the system variable [`require_secure_transport`](/system-variables.md#require_secure_transport-new-in-v610) to require secure connections to the TiDB server for all users. -+ Specify `REQUIRE SSL` when you create a user (`create user`), or modify an existing user (`alter user`), which is to specify that specified users must use TLS connections to access TiDB. The following is an example of creating a user: - - {{< copyable "sql" >}} ++ Specify `REQUIRE SSL` when you create a user (`CREATE USER`), or modify an existing user (`ALTER USER`), which is to specify that specified users must use TLS connections to access TiDB. The following is an example of creating a user: ```sql CREATE USER 'u1'@'%' IDENTIFIED BY 'my_random_password' REQUIRE SSL; @@ -51,6 +49,10 @@ All the files specified by the parameters are in PEM (Privacy Enhanced Mail) for If the certificate parameters are correct, TiDB outputs `mysql protocol server secure connection is enabled` to the logs on `"INFO"` level when started. +## Configure TiProxy to use TLS connections + +By specifying the [sql-tls](/tiproxy/tiproxy-configuration.md#sql-tls) in the [TiProxy](/tiproxy/tiproxy-overview.md) configuration TiProxy is able to accept TLS connections. For more details on this and how to enable TLS on backend connections see [TiProxy Security](/tiproxy/tiproxy-overview.md#security). + ## Configure the MySQL client to use TLS connections The client of MySQL 5.7 or later versions attempts to establish a TLS connection by default. If the server does not support TLS connections, it automatically returns to unencrypted connections. The client of MySQL earlier than version 5.7 uses the non-TLS connections by default. @@ -90,7 +92,7 @@ If the `ssl-ca` parameter is not specified in the TiDB server or MySQL client, t By default, the server-to-client authentication is optional. Even if the client does not present its certificate of identification during the TLS handshake, the TLS connection can be still established. You can also require the client to be authenticated by specifying `REQUIRE x509` when creating a user (`CREATE USER`), or modifying an existing user (`ALTER USER`). The following is an example of creating a user: ```sql -CREATE USER 'u1'@'%' REQUIRE X509; +CREATE USER 'u1'@'%' REQUIRE X509; ``` > **Note:** From fc06ec53f7a8b9542613ce9288c20c4e18cfc117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 26 Sep 2025 15:12:41 +0200 Subject: [PATCH 2/2] Update enable-tls-between-clients-and-servers.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- enable-tls-between-clients-and-servers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enable-tls-between-clients-and-servers.md b/enable-tls-between-clients-and-servers.md index 6b5603ebc3dfc..95b23d0e58d99 100644 --- a/enable-tls-between-clients-and-servers.md +++ b/enable-tls-between-clients-and-servers.md @@ -51,7 +51,7 @@ If the certificate parameters are correct, TiDB outputs `mysql protocol server s ## Configure TiProxy to use TLS connections -By specifying the [sql-tls](/tiproxy/tiproxy-configuration.md#sql-tls) in the [TiProxy](/tiproxy/tiproxy-overview.md) configuration TiProxy is able to accept TLS connections. For more details on this and how to enable TLS on backend connections see [TiProxy Security](/tiproxy/tiproxy-overview.md#security). +By specifying the [`sql-tls`](/tiproxy/tiproxy-configuration.md#sql-tls) settings in the [TiProxy](/tiproxy/tiproxy-overview.md) configuration, you can enable TiProxy to accept TLS connections. For more details on this and how to enable TLS on backend connections, see [TiProxy Security](/tiproxy/tiproxy-overview.md#security). ## Configure the MySQL client to use TLS connections