lnd: create empty tls config on empty cert path

pull/110/head
George Tsagkarelis 11 months ago
parent ff60071b7d
commit 884866d49d
No known key found for this signature in database
GPG Key ID: E08DEA9B12B66AF6

@ -1,6 +1,7 @@
package lnd package lnd
import ( import (
"crypto/tls"
"io/ioutil" "io/ioutil"
"net/url" "net/url"
@ -37,9 +38,14 @@ func newClientConn(c *config.Network) (*grpc.ClientConn, error) {
return nil, errors.WithStack(err) return nil, errors.WithStack(err)
} }
cred, err := credentials.NewClientTLSFromFile(c.Cert, "") var cred credentials.TransportCredentials
if err != nil { if c.Cert != "" {
return nil, err cred, err = credentials.NewClientTLSFromFile(c.Cert, "")
if err != nil {
return nil, err
}
} else {
cred = credentials.NewTLS(&tls.Config{})
} }
u, err := url.Parse(c.Address) u, err := url.Parse(c.Address)

Loading…
Cancel
Save