-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.component/lightningThis issue is related to Lightning of TiDB.This issue is related to Lightning of TiDB.severity/majortype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
-
tidb cluster open cluster tls but no client tls
2. What did you expect to see? (Required)
- db connect ok
3. What did you see instead (Required)
- tidb lightning encountered error: [Lightning:DB:ErrDBConnect]failed to connect database: TLS requested but server does not support TLS
- some code shows that tlsconfig won't change
tidb/pkg/lightning/config/config.go
Lines 177 to 200 in c60f97d
if d.Security == nil { d.Security = s } switch d.TLS { case "skip-verify", "preferred": if d.Security.TLSConfig == nil { /* #nosec G402 */ d.Security.TLSConfig = &tls.Config{ MinVersion: tls.VersionTLS12, InsecureSkipVerify: true, NextProtos: []string{"h2", "http/1.1"}, // specify `h2` to let Go use HTTP/2. } d.Security.AllowFallbackToPlaintext = true } case "cluster": if len(s.CAPath) == 0 { return common.ErrInvalidConfig.GenWithStack("cannot set `tidb.tls` to 'cluster' without a [security] section") } case "", "false": d.TLS = "false" default: return common.ErrInvalidConfig.GenWithStack("unsupported `tidb.tls` config %s", d.TLS) }
4. What is your TiDB version? (Required)
master
Metadata
Metadata
Assignees
Labels
affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.component/lightningThis issue is related to Lightning of TiDB.This issue is related to Lightning of TiDB.severity/majortype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.