Skip to content

Commit

Permalink
Merge pull request #110 from GeorgeTsagk/empty-cert
Browse files Browse the repository at this point in the history
lnd: create empty tls config on empty cert path
  • Loading branch information
edouardparis authored Jun 13, 2023
2 parents ff60071 + 884866d commit 2e132b2
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 2e132b2

Please sign in to comment.