Remove conn.Close() in tlsCred.ServerHandshake()
Removes the responsibility from tlsCred.ServerHandshake() of calling Close() on the underlying connection. Returning an error is enough to close the connection: https://github.com/grpc/grpc-go/blob/master/server.go#L370.
This commit is contained in:
@ -167,7 +167,6 @@ func (c *tlsCreds) ClientHandshake(ctx context.Context, addr string, rawConn net
|
||||
func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) {
|
||||
conn := tls.Server(rawConn, c.config)
|
||||
if err := conn.Handshake(); err != nil {
|
||||
rawConn.Close()
|
||||
return nil, nil, err
|
||||
}
|
||||
return conn, TLSInfo{conn.ConnectionState()}, nil
|
||||
|
Reference in New Issue
Block a user