Browse Source

server: add TLSHandshakeTimeout for peer hub client

Yicheng Qin 11 năm trước cách đây
mục cha
commit
c9edb762b7
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      etcd/etcd.go

+ 1 - 0
etcd/etcd.go

@@ -76,6 +76,7 @@ func New(c *config.Config) (*Server, error) {
 	tr := new(http.Transport)
 	tr.TLSClientConfig = tc
 	tr.Dial = (&net.Dialer{Timeout: 200 * time.Millisecond}).Dial
+	tr.TLSHandshakeTimeout = 10 * time.Second
 	tr.ResponseHeaderTimeout = defaultTickDuration * defaultHeartbeat
 	client := &http.Client{Transport: tr}