瀏覽代碼

fix(etcd): remove insecureskipverify

The client certs and server certs should share the same CA since
everyone is a peer. Use this logic instead of InsecureSkipVerify.

Test-plan: tested manually and tests pass still.
Brandon Philips 12 年之前
父節點
當前提交
be85442e5e
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      etcd.go

+ 3 - 1
etcd.go

@@ -481,8 +481,10 @@ func tlsConfigFromInfo(info TLSInfo) (t TLSConfig, ok bool) {
 	t.Scheme = "https"
 	t.Scheme = "https"
 	t.Server.ClientAuth, t.Server.ClientCAs = newCertPool(CAFile)
 	t.Server.ClientAuth, t.Server.ClientCAs = newCertPool(CAFile)
 
 
+	// The client should trust the RootCA that the Server uses since
+	// everyone is a peer in the network.
 	t.Client.Certificates = []tls.Certificate{tlsCert}
 	t.Client.Certificates = []tls.Certificate{tlsCert}
-	t.Client.InsecureSkipVerify = true
+	t.Client.RootCAs = t.Server.ClientCAs
 
 
 	return t, true
 	return t, true
 }
 }