use unique datasource id when registering mysql tls config

This commit is contained in:
Marcus Efraimsson 2019-02-08 18:08:07 +01:00
parent f157c19e16
commit 1bc2a0af70
No known key found for this signature in database
GPG Key ID: EBFE0FB04612DD4A

View File

@ -39,8 +39,9 @@ func newMysqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
}
if tlsConfig.RootCAs != nil || len(tlsConfig.Certificates) > 0 {
mysql.RegisterTLSConfig(datasource.Name, tlsConfig)
cnnstr += "&tls=" + datasource.Name
tlsConfigString := fmt.Sprintf("ds%d", datasource.Id)
mysql.RegisterTLSConfig(tlsConfigString, tlsConfig)
cnnstr += "&tls=" + tlsConfigString
}
logger.Debug("getEngine", "connection", cnnstr)