Merge pull request #5541 from influxdata/tls-client

Support for adding custom TLS Config for HTTP client
pull/5387/merge
Jason Wilder 2016-02-08 11:58:52 -07:00
commit ddcdd97416
1 changed files with 7 additions and 0 deletions

View File

@ -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,