From f5f29a509f3c8a39de6b2c3df3f5343db9469f00 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Sat, 13 Jul 2019 10:42:32 -0700 Subject: [PATCH] embed: use new "credentials" package Signed-off-by: Gyuho Lee --- embed/serve.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/embed/serve.go b/embed/serve.go index 8e6e7b769a20..62829ee5975a 100644 --- a/embed/serve.go +++ b/embed/serve.go @@ -23,6 +23,7 @@ import ( "net/http" "strings" + "go.etcd.io/etcd/clientv3/credentials" "go.etcd.io/etcd/etcdserver" "go.etcd.io/etcd/etcdserver/api/v3client" "go.etcd.io/etcd/etcdserver/api/v3election" @@ -43,7 +44,6 @@ import ( "go.uber.org/zap" "golang.org/x/net/trace" "google.golang.org/grpc" - "google.golang.org/grpc/credentials" ) type serveCtx struct { @@ -163,8 +163,8 @@ func (sctx *serveCtx) serve( dtls := tlscfg.Clone() // trust local server dtls.InsecureSkipVerify = true - creds := credentials.NewTLS(dtls) - opts := []grpc.DialOption{grpc.WithTransportCredentials(creds)} + bundle := credentials.NewBundle(credentials.Config{TLSConfig: dtls}) + opts := []grpc.DialOption{grpc.WithTransportCredentials(bundle.TransportCredentials())} gwmux, err = sctx.registerGateway(opts) if err != nil { return err