Allow InfluxDB to use insecure TLS without cert bundle (#8778)
Moves the configuration of insecure TLS and TLS version outside of the certificate bundle.
This commit is contained in:
parent
3b4ba9d1fb
commit
8aee6262c1
|
@ -194,20 +194,22 @@ func (i *influxdbConnectionProducer) createClient() (influx.Client, error) {
|
|||
if err != nil || tlsConfig == nil {
|
||||
return nil, errwrap.Wrapf(fmt.Sprintf("failed to get TLS configuration: tlsConfig:%#v err:{{err}}", tlsConfig), err)
|
||||
}
|
||||
tlsConfig.InsecureSkipVerify = i.InsecureTLS
|
||||
|
||||
if i.TLSMinVersion != "" {
|
||||
var ok bool
|
||||
tlsConfig.MinVersion, ok = tlsutil.TLSLookup[i.TLSMinVersion]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("invalid 'tls_min_version' in config")
|
||||
}
|
||||
} else {
|
||||
// MinVersion was not being set earlier. Reset it to
|
||||
// zero to gracefully handle upgrades.
|
||||
tlsConfig.MinVersion = 0
|
||||
}
|
||||
}
|
||||
|
||||
tlsConfig.InsecureSkipVerify = i.InsecureTLS
|
||||
|
||||
if i.TLSMinVersion != "" {
|
||||
var ok bool
|
||||
tlsConfig.MinVersion, ok = tlsutil.TLSLookup[i.TLSMinVersion]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("invalid 'tls_min_version' in config")
|
||||
}
|
||||
} else {
|
||||
// MinVersion was not being set earlier. Reset it to
|
||||
// zero to gracefully handle upgrades.
|
||||
tlsConfig.MinVersion = 0
|
||||
}
|
||||
|
||||
clientConfig.TLSConfig = tlsConfig
|
||||
clientConfig.Addr = fmt.Sprintf("https://%s:%s", i.Host, i.Port)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue