From 95207c9617ee1c4e7d8c65f26f41649a79d95212 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 12 Jun 2023 18:29:07 +0300 Subject: [PATCH] dont init twice tls listener Signed-off-by: Vasiliy Tolstov --- grpc.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/grpc.go b/grpc.go index d569bdc..158dd57 100644 --- a/grpc.go +++ b/grpc.go @@ -26,7 +26,6 @@ import ( "golang.org/x/net/netutil" "google.golang.org/grpc" "google.golang.org/grpc/codes" - "google.golang.org/grpc/credentials" "google.golang.org/grpc/encoding" gmetadata "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" @@ -140,10 +139,6 @@ func (g *Server) configure(opts ...server.Option) error { grpc.UnknownServiceHandler(g.handler), } - if creds := g.getCredentials(); creds != nil { - gopts = append(gopts, grpc.Creds(creds)) - } - if opts := g.getGrpcOptions(); opts != nil { gopts = append(opts, gopts...) } @@ -180,13 +175,6 @@ func (g *Server) getMaxMsgSize() int { return s } -func (g *Server) getCredentials() credentials.TransportCredentials { - if g.opts.TLSConfig != nil { - return credentials.NewTLS(g.opts.TLSConfig) - } - return nil -} - func (g *Server) getGrpcOptions() []grpc.ServerOption { if g.opts.Context == nil { return nil