diff --git a/.github/workflows/regtest-mint.yml b/.github/workflows/regtest-mint.yml index 73fac68e7..7672e7e72 100644 --- a/.github/workflows/regtest-mint.yml +++ b/.github/workflows/regtest-mint.yml @@ -61,6 +61,7 @@ jobs: # LndRestWallet MINT_LND_REST_ENDPOINT: https://localhost:8081/ MINT_LND_REST_CERT: ./regtest/data/lnd-3/tls.cert + MINT_LND_REST_CERT_VERIFY: false MINT_LND_REST_MACAROON: ./regtest/data/lnd-3/data/chain/bitcoin/regtest/admin.macaroon # LndRPCWallet MINT_LND_RPC_ENDPOINT: localhost:10009 @@ -70,10 +71,12 @@ jobs: MINT_CORELIGHTNING_REST_URL: https://localhost:3001 MINT_CORELIGHTNING_REST_MACAROON: ./regtest/data/clightning-2-rest/access.macaroon MINT_CORELIGHTNING_REST_CERT: ./regtest/data/clightning-2-rest/certificate.pem + MINT_CORELIGHTNING_REST_CERT_VERIFY: false # CLNRestWallet MINT_CLNREST_URL: https://localhost:3010 MINT_CLNREST_RUNE: ./regtest/data/clightning-2/rune MINT_CLNREST_CERT: ./regtest/data/clightning-2/regtest/ca.pem + MINT_CLNREST_CERT_VERIFY: false run: | sudo chmod -R 777 . make test-mint diff --git a/.github/workflows/regtest-wallet.yml b/.github/workflows/regtest-wallet.yml index 284939600..1a1072c1d 100644 --- a/.github/workflows/regtest-wallet.yml +++ b/.github/workflows/regtest-wallet.yml @@ -61,6 +61,7 @@ jobs: # LndRestWallet MINT_LND_REST_ENDPOINT: https://localhost:8081/ MINT_LND_REST_CERT: ./regtest/data/lnd-3/tls.cert + MINT_LND_REST_CERT_VERIFY: false MINT_LND_REST_MACAROON: ./regtest/data/lnd-3/data/chain/bitcoin/regtest/admin.macaroon # LndRPCWallet MINT_LND_RPC_ENDPOINT: localhost:10009 @@ -70,10 +71,12 @@ jobs: MINT_CORELIGHTNING_REST_URL: https://localhost:3001 MINT_CORELIGHTNING_REST_MACAROON: ./regtest/data/clightning-2-rest/access.macaroon MINT_CORELIGHTNING_REST_CERT: ./regtest/data/clightning-2-rest/certificate.pem + MINT_CORELIGHTNING_REST_CERT_VERIFY: false # CLNRestWallet MINT_CLNREST_URL: https://localhost:3010 MINT_CLNREST_RUNE: ./regtest/data/clightning-2/rune MINT_CLNREST_CERT: ./regtest/data/clightning-2/regtest/ca.pem + MINT_CLNREST_CERT_VERIFY: false run: | sudo chmod -R 777 . make test-wallet diff --git a/cashu/core/settings.py b/cashu/core/settings.py index 07bf128fa..eb789b1f8 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -315,6 +315,7 @@ class LndRPCFundingSource(MintSettings): class CLNRestFundingSource(MintSettings): mint_clnrest_url: Optional[str] = Field(default=None) mint_clnrest_cert: Optional[str] = Field(default=None) + mint_clnrest_cert_verify: bool = Field(default=True) mint_clnrest_rune: Optional[str] = Field(default=None) mint_clnrest_enable_mpp: bool = Field(default=True) @@ -323,6 +324,7 @@ class CoreLightningRestFundingSource(MintSettings): mint_corelightning_rest_url: Optional[str] = Field(default=None) mint_corelightning_rest_macaroon: Optional[str] = Field(default=None) mint_corelightning_rest_cert: Optional[str] = Field(default=None) + mint_corelightning_rest_cert_verify: bool = Field(default=True) class AuthSettings(MintSettings): diff --git a/cashu/lightning/clnrest.py b/cashu/lightning/clnrest.py index fe8c05657..e1c5b2cd0 100644 --- a/cashu/lightning/clnrest.py +++ b/cashu/lightning/clnrest.py @@ -79,8 +79,9 @@ def __init__(self, unit: Unit = Unit.sat, **kwargs): } self.cert = settings.mint_clnrest_cert or False + verify = self.cert if settings.mint_clnrest_cert_verify else False self.client = httpx.AsyncClient( - base_url=self.url, verify=self.cert, headers=self.auth, timeout=None, + base_url=self.url, verify=verify, headers=self.auth, timeout=None, ) self.last_pay_index = 0 diff --git a/cashu/lightning/corelightningrest.py b/cashu/lightning/corelightningrest.py index ac7c8c735..bf1b5a787 100644 --- a/cashu/lightning/corelightningrest.py +++ b/cashu/lightning/corelightningrest.py @@ -72,8 +72,9 @@ def __init__(self, unit: Unit = Unit.sat, **kwargs): } self.cert = settings.mint_corelightning_rest_cert or False + verify = self.cert if settings.mint_corelightning_rest_cert_verify else False self.client = httpx.AsyncClient( - base_url=self.url, verify=self.cert, headers=self.auth + base_url=self.url, verify=verify, headers=self.auth ) self.last_pay_index = 0 diff --git a/tests/conftest.py b/tests/conftest.py index 0873740c3..f8a229b5b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -84,7 +84,8 @@ def run(self, *args, **kwargs): async def ledger(): async def start_mint_init(ledger: Ledger) -> Ledger: await migrate_databases(ledger.db, migrations_mint) - await ledger.startup_ledger() + await ledger._startup_keysets() + await ledger._check_backends() return ledger if not settings.mint_database.startswith("postgres"):