Here when gh-ost is recursively finding masters:
|
masterConfig = connectionConfig.Duplicate() |
It copies the entire connectionConfig, including the private tlsConfig field:
|
tlsConfig: this.tlsConfig, |
without updating its hostname:
|
ServerName: this.Key.Hostname, |
Hence, it tries to connect to a new host likely with a different hostname and certificate, but still asks x509 to verify against the old hostname, which always fails:
x509: certificate is valid for [old hostname], not [newly found hostname]