Skip to content

Commit

Permalink
Register TLS config when setting up the throttler's connection info
Browse files Browse the repository at this point in the history
This ensures that the throttler's TLS config has been registered with
the mysql driver before any connections are attempted.

This is the second part of resolving the following TLS verify
error:

2025-01-02 02:07:26 FATAL tls: failed to verify certificate: x509: certificate is valid for [old host], not [new host]
  • Loading branch information
petervandoros committed Jan 2, 2025
1 parent 15daab8 commit 0fa2033
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/logic/throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ func (this *Throttler) collectControlReplicasLag() {
lagResults := make(chan *mysql.ReplicationLagResult, instanceKeyMap.Len())
for replicaKey := range *instanceKeyMap {
connectionConfig := this.migrationContext.InspectorConnectionConfig.DuplicateCredentials(replicaKey)
if err := connectionConfig.RegisterTLSConfig(); err != nil {
return &mysql.ReplicationLagResult{Err: err}
}

lagResult := &mysql.ReplicationLagResult{Key: connectionConfig.Key}
go func() {
Expand Down

0 comments on commit 0fa2033

Please sign in to comment.