fix uninitialized tlsConfig in influxdb plugin (#10899)

This commit is contained in:
Johan Leinfors 2021-03-19 04:14:15 +01:00 committed by GitHub
parent 6ea82f6d1a
commit 820b3b1bf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ func (i *influxdbConnectionProducer) createClient() (influx.Client, error) {
}
if i.TLS {
var tlsConfig *tls.Config
tlsConfig := &tls.Config{}
if len(i.certificate) > 0 || len(i.issuingCA) > 0 {
if len(i.certificate) > 0 && len(i.privateKey) == 0 {
return nil, fmt.Errorf("found certificate for TLS authentication but no private key")