diff --git a/config/config.go b/config/config.go index 60ab139d0aaf6..b4640a109e41e 100644 --- a/config/config.go +++ b/config/config.go @@ -704,7 +704,7 @@ var defaultConf = Config{ Security: Security{ SpilledFileEncryptionMethod: SpilledFileEncryptionMethodPlaintext, EnableSEM: false, - AutoTLS: true, + AutoTLS: false, RSAKeySize: 4096, }, DeprecateIntegerDisplayWidth: false, diff --git a/config/config.toml.example b/config/config.toml.example index 40f7258375b1d..6d9928fe67701 100644 --- a/config/config.toml.example +++ b/config/config.toml.example @@ -205,7 +205,9 @@ spilled-file-encryption-method = "plaintext" # Security Enhanced Mode (SEM) restricts the "SUPER" privilege and requires fine-grained privileges instead. enable-sem = false -# Automatic creation of TLS certificates +# Automatic creation of TLS certificates. +# Setting it to 'true' is recommended because it is safer and tie with the default configuration of MySQL. +# If this config is commented/missed, the value would be 'false' for the compatibility with TiDB versions that does not support it. auto-tls = true # Minium TLS version to use, e.g. "TLSv1.2" diff --git a/config/config_test.go b/config/config_test.go index bfcdaae176c6f..7b0bfe434b45f 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -344,7 +344,8 @@ spilled-file-encryption-method = "aes128-ctr" configFile = filepath.Join(filepath.Dir(localFile), "config.toml.example") require.NoError(t, conf.Load(configFile)) - // Make sure the example config is the same as default config. + // Make sure the example config is the same as default config except `auto_tls`. + conf.Security.AutoTLS = false require.Equal(t, GetGlobalConfig(), conf) // Test for log config.