@@ -151,12 +151,9 @@ func extractPathArgs(ctx *cli.Context) (string, error) {
151
151
return "" , err
152
152
}
153
153
154
- // We'll now fetch the basedir so we can make a decision on how to
155
- // properly read the cert. This will either be the default,
156
- // or will have been overwritten by the end user.
157
- baseDir := lncfg .CleanAndExpandPath (ctx .GlobalString (baseDirFlag .Name ))
154
+ // Get the LND mode. If Lit is in integrated LND mode, then LND's tls
155
+ // cert is used directly. Otherwise, Lit's own tls cert is used.
158
156
lndmode := strings .ToLower (ctx .GlobalString (lndMode .Name ))
159
-
160
157
if lndmode == terminal .ModeIntegrated {
161
158
tlsCertPath := lncfg .CleanAndExpandPath (ctx .GlobalString (
162
159
lndTlsCertFlag .Name ,
@@ -165,18 +162,25 @@ func extractPathArgs(ctx *cli.Context) (string, error) {
165
162
return tlsCertPath , nil
166
163
}
167
164
165
+ // Lit is in remote LND mode. So we need Lit's tls cert.
168
166
tlsCertPath := lncfg .CleanAndExpandPath (ctx .GlobalString (
169
167
tlsCertFlag .Name ,
170
168
))
171
169
170
+ // If a custom TLS path was set, use it as is.
171
+ if tlsCertPath != terminal .DefaultTLSCertPath {
172
+ return tlsCertPath , nil
173
+ }
174
+
172
175
// If a custom base directory was set, we'll also check if custom paths
173
176
// for the TLS cert file was set as well. If not, we'll override the
174
177
// paths so they can be found within the custom base directory set.
175
178
// This allows us to set a custom base directory, along with custom
176
179
// paths to the TLS cert file.
177
- if baseDir != terminal .DefaultLitDir || networkStr != terminal .DefaultNetwork {
180
+ baseDir := lncfg .CleanAndExpandPath (ctx .GlobalString (baseDirFlag .Name ))
181
+ if baseDir != terminal .DefaultLitDir {
178
182
tlsCertPath = filepath .Join (
179
- baseDir , networkStr , terminal .DefaultTLSCertFilename ,
183
+ baseDir , terminal .DefaultTLSCertFilename ,
180
184
)
181
185
}
182
186
0 commit comments