lncli: check for existence of tls file (#5416)
This commit is contained in:
commit
1910e263a8
@ -124,12 +124,11 @@ func profileFromContext(ctx *cli.Context, store, skipMacaroons bool) (
|
|||||||
// Load the certificate file now, if specified. We store it as plain PEM
|
// Load the certificate file now, if specified. We store it as plain PEM
|
||||||
// directly.
|
// directly.
|
||||||
var tlsCert []byte
|
var tlsCert []byte
|
||||||
if lnrpc.FileExists(tlsCertPath) {
|
if tlsCertPath != "" {
|
||||||
var err error
|
var err error
|
||||||
tlsCert, err = ioutil.ReadFile(tlsCertPath)
|
tlsCert, err = ioutil.ReadFile(tlsCertPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("could not load TLS cert file "+
|
return nil, fmt.Errorf("could not load TLS cert file: %v", err)
|
||||||
"%s: %v", tlsCertPath, err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user