Feat: enable tls in chart

add tls related code in chart server

Signed-off-by: DQ <dengq@vmware.com>
This commit is contained in:
DQ 2020-02-11 14:38:45 +08:00
parent e6bb3b0977
commit 10753caf90

View File

@ -31,12 +31,12 @@ type ChartClient struct {
// NewChartClient is constructor of ChartClient // NewChartClient is constructor of ChartClient
// credential can be nil // credential can be nil
func NewChartClient(credential *Credential) *ChartClient { // Create http client with customized timeouts func NewChartClient(credential *Credential) *ChartClient { // Create http client with customized timeouts
tr := commonhttp.GetHTTPTransport(commonhttp.InternalTransport)
tr.MaxIdleConns = maxIdleConnections
tr.IdleConnTimeout = idleConnectionTimeout
client := &http.Client{ client := &http.Client{
Timeout: clientTimeout, Timeout: clientTimeout,
Transport: &http.Transport{ Transport: tr,
MaxIdleConns: maxIdleConnections,
IdleConnTimeout: idleConnectionTimeout,
},
} }
return &ChartClient{ return &ChartClient{