Browse Source

etcd: wire up peer TLS flags

Brian Waldon 11 years ago
parent
commit
27813599a1
1 changed files with 7 additions and 2 deletions
  1. 7 2
      main.go

+ 7 - 2
main.go

@@ -51,6 +51,7 @@ var (
 	}
 
 	clientTLSInfo = transport.TLSInfo{}
+	peerTLSInfo   = transport.TLSInfo{}
 )
 
 func init() {
@@ -65,6 +66,10 @@ func init() {
 	flag.StringVar(&clientTLSInfo.CAFile, "ca-file", "", "Path to the client server TLS CA file.")
 	flag.StringVar(&clientTLSInfo.CertFile, "cert-file", "", "Path to the client server TLS cert file.")
 	flag.StringVar(&clientTLSInfo.KeyFile, "key-file", "", "Path to the client server TLS key file.")
+
+	flag.StringVar(&peerTLSInfo.CAFile, "peer-ca-file", "", "Path to the peer server TLS CA file.")
+	flag.StringVar(&peerTLSInfo.CertFile, "peer-cert-file", "", "Path to the peer server TLS cert file.")
+	flag.StringVar(&peerTLSInfo.KeyFile, "peer-key-file", "", "Path to the peer server TLS key file.")
 }
 
 func main() {
@@ -151,7 +156,7 @@ func startEtcd() {
 		n = raft.RestartNode(id, peers.IDs(), 10, 1, snapshot, st, ents)
 	}
 
-	pt, err := transport.NewTransport(transport.TLSInfo{})
+	pt, err := transport.NewTransport(peerTLSInfo)
 	if err != nil {
 		log.Fatal(err)
 	}
@@ -179,7 +184,7 @@ func startEtcd() {
 		Info:    cors,
 	}
 
-	l, err := transport.NewListener(*paddr, transport.TLSInfo{})
+	l, err := transport.NewListener(*paddr, peerTLSInfo)
 	if err != nil {
 		log.Fatal(err)
 	}