fix(lightning): restore CA-validated https agent for LNbits requests#3869
Merged
davidleomay merged 1 commit intoJun 11, 2026
Merged
Conversation
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.
davidleomay
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#3854 moved the shared
https.Agentinto theLightningClientconstructor but only kept it for LND requests —httpLnBitsConfig()lost itshttpsAgententirely. 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,lintcleanjest src/integration/lightning: 12/12 passed