Merge pull request #5541 from influxdata/tls-client
Support for adding custom TLS Config for HTTP clientpull/5387/merge
commit
ddcdd97416
|
@ -41,6 +41,10 @@ type HTTPConfig struct {
|
|||
// InsecureSkipVerify gets passed to the http client, if true, it will
|
||||
// skip https certificate verification. Defaults to false
|
||||
InsecureSkipVerify bool
|
||||
|
||||
// TLSConfig allows the user to set their own TLS config for the HTTP
|
||||
// Client. If set, this option overrides InsecureSkipVerify.
|
||||
TLSConfig *tls.Config
|
||||
}
|
||||
|
||||
type UDPConfig struct {
|
||||
|
@ -100,6 +104,9 @@ func NewHTTPClient(conf HTTPConfig) (Client, error) {
|
|||
InsecureSkipVerify: conf.InsecureSkipVerify,
|
||||
},
|
||||
}
|
||||
if conf.TLSConfig != nil {
|
||||
tr.TLSClientConfig = conf.TLSConfig
|
||||
}
|
||||
return &client{
|
||||
url: u,
|
||||
username: conf.Username,
|
||||
|
|
Loading…
Reference in New Issue