Ignore invalid certificate over Tor for CLN autowithdrawals (#1165)

* Use env var for tor proxy

* Disable cert validation over Tor
This commit is contained in:
ekzyis 2024-05-09 21:07:47 -05:00 committed by GitHub
parent 46efb770fb
commit aacf7c6170
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -148,3 +148,6 @@ AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
PERSISTENCE=1
SKIP_SSL_CERT_DOWNLOAD=1
# tor
TOR_PROXY=http://127.0.0.1:7050/

View File

@ -15,4 +15,5 @@ NEXT_PUBLIC_FAST_POLL_INTERVAL=1000
NEXT_PUBLIC_NORMAL_POLL_INTERVAL=30000
NEXT_PUBLIC_LONG_POLL_INTERVAL=60000
NEXT_PUBLIC_EXTRA_LONG_POLL_INTERVAL=300000
NEXT_PUBLIC_URL=https://stacker.news
NEXT_PUBLIC_URL=https://stacker.news
TOR_PROXY=http://127.0.0.1:7050/

View File

@ -11,9 +11,9 @@ export const createInvoice = async ({ socket, rune, cert, label, description, ms
// we support HTTP and HTTPS over Tor
protocol = cert ? 'https:' : 'http:'
// we need to use our Tor proxy to resolve onion addresses
const proxyOptions = { proxy: 'http://127.0.0.1:7050/' }
const proxyOptions = { proxy: process.env.TOR_PROXY }
agent = protocol === 'https:'
? new HttpsProxyAgent({ ...proxyOptions, ...httpsAgentOptions })
? new HttpsProxyAgent({ ...proxyOptions, ...httpsAgentOptions, rejectUnauthorized: false })
: new HttpProxyAgent(proxyOptions)
} else {
// we only support HTTPS over clearnet