mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
Merge pull request #4228 from yousong/bugfix/yousong-mcclient-proxy
Bugfix/yousong mcclient proxy
This commit is contained in:
@@ -19,7 +19,6 @@ import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -58,14 +57,10 @@ func NewClient(authUrl string, timeout int, debug bool, insecure bool, certFile,
|
||||
}
|
||||
tlsConf.InsecureSkipVerify = insecure
|
||||
|
||||
tr := &http.Transport{
|
||||
TLSClientConfig: tlsConf,
|
||||
DialContext: (&net.Dialer{
|
||||
Timeout: 5 * time.Second,
|
||||
}).DialContext,
|
||||
IdleConnTimeout: 5 * time.Second,
|
||||
TLSHandshakeTimeout: 10 * time.Second,
|
||||
}
|
||||
tr := httputils.GetTransport(insecure, 5*time.Second)
|
||||
tr.TLSClientConfig = tlsConf
|
||||
tr.IdleConnTimeout = 5 * time.Second
|
||||
tr.TLSHandshakeTimeout = 10 * time.Second
|
||||
|
||||
client := Client{authUrl: authUrl,
|
||||
timeout: timeout,
|
||||
|
||||
@@ -153,7 +153,6 @@ func GetTransport(insecure bool, timeout time.Duration) *http.Transport {
|
||||
TLSHandshakeTimeout: 10 * time.Second,
|
||||
ExpectContinueTimeout: 1 * time.Second,
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: insecure},
|
||||
DisableCompression: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user