Skip to content

Commit

Permalink
lnd: create empty tls config on empty cert path
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeTsagk committed Jun 6, 2023
1 parent ff60071 commit 884866d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions network/backend/lnd/conn.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package lnd

import (
"crypto/tls"
"io/ioutil"
"net/url"

Expand Down Expand Up @@ -37,9 +38,14 @@ func newClientConn(c *config.Network) (*grpc.ClientConn, error) {
return nil, errors.WithStack(err)
}

cred, err := credentials.NewClientTLSFromFile(c.Cert, "")
if err != nil {
return nil, err
var cred credentials.TransportCredentials
if c.Cert != "" {
cred, err = credentials.NewClientTLSFromFile(c.Cert, "")
if err != nil {
return nil, err
}
} else {
cred = credentials.NewTLS(&tls.Config{})
}

u, err := url.Parse(c.Address)
Expand Down

0 comments on commit 884866d

Please sign in to comment.