Merge pull request #4228 from yousong/bugfix/yousong-mcclient-proxy

Bugfix/yousong mcclient proxy
This commit is contained in:
yunion-ci-robot
2019-12-20 18:11:04 +08:00
committed by GitHub
2 changed files with 4 additions and 10 deletions
+4 -9
View File
@@ -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,
-1
View File
@@ -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,
}
}