Skip to content

fix(lightning): restore CA-validated https agent for LNbits requests#3869

Merged
davidleomay merged 1 commit into
fix/lnurl-ssrf-path-traversalfrom
fix/lnbits-https-agent
Jun 11, 2026
Merged

fix(lightning): restore CA-validated https agent for LNbits requests#3869
davidleomay merged 1 commit into
fix/lnurl-ssrf-path-traversalfrom
fix/lnbits-https-agent

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

Problem

#3854 moved the shared https.Agent into the LightningClient constructor but only kept it for LND requests — httpLnBitsConfig() lost its httpsAgent entirely. LNbits requests are now verified against system CAs only.

In production LNbits is reached over HTTPS serving the self-signed LND certificate, so without the CA agent every LNbits call fails TLS verification (LNURL forwarding, lnurlp invoices, balance checks). This was not caught on dev because LNbits runs over plain HTTP there.

Fix

Reuse one shared CA-validated agent (tlsAgent) for both LND and LNbits requests — same behavior as before #3854, without per-request agent allocation.

Why this base branch

Targets fix/lnurl-ssrf-path-traversal (#3862) so both lightning-client fixes land in develop together; this fix is a release blocker for #3857.

Checks

  • format:check, type-check, lint clean
  • jest src/integration/lightning: 12/12 passed

The Agent reuse refactoring dropped the CA-validated httpsAgent from
httpLnBitsConfig, so LNbits requests are verified against system CAs
only. In production LNbits serves the self-signed LND certificate,
which makes every LNbits call fail TLS verification. Reuse one shared
CA-validated agent for both LND and LNbits requests.
@TaprootFreak TaprootFreak marked this pull request as ready for review June 11, 2026 18:19
@davidleomay davidleomay merged commit 8250788 into fix/lnurl-ssrf-path-traversal Jun 11, 2026
1 check passed
@davidleomay davidleomay deleted the fix/lnbits-https-agent branch June 11, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants