Skip to content

Commit

Permalink
fix: remove lnd certificate from user config if not provided (#1106)
Browse files Browse the repository at this point in the history
* fix: remove lnd certificate from user config if not provided

* chore: change comment

* chore: only set empty certhex if backend is LND
  • Loading branch information
im-adithya authored Feb 20, 2025
1 parent e2e5967 commit f561547
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ func (cfg *config) init(env *AppConfig) error {
if err != nil {
return err
}
} else if cfg.Env.LNBackendType == "LND" {
// If no LNDCertFile is provided, clear any stored certificate
// hex value so that no certificate is used for TLS verification.
err := cfg.SetUpdate("LNDCertHex", "", "")
if err != nil {
return err
}
}
if cfg.Env.LNDMacaroonFile != "" {
macBytes, err := os.ReadFile(cfg.Env.LNDMacaroonFile)
Expand Down

0 comments on commit f561547

Please sign in to comment.