mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Enabling dual support - clients with or without macaroons/tls
This commit is contained in:
parent
f97173e9e7
commit
7c29cb62ef
1 changed files with 6 additions and 3 deletions
|
@ -28,9 +28,12 @@ namespace BTCPayServer.Payments.Lightning.Lnd
|
||||||
//
|
//
|
||||||
public static LndSwaggerClientCustomHttp Create(Uri uri, Network network, byte[] tlsCertificate = null, byte[] grpcMacaroon = null)
|
public static LndSwaggerClientCustomHttp Create(Uri uri, Network network, byte[] tlsCertificate = null, byte[] grpcMacaroon = null)
|
||||||
{
|
{
|
||||||
// for now working with custom build of lnd that has no macaroons and is on http
|
// for development we are working with custom build of lnd that allows no macaroons and http
|
||||||
//_HttpClient = HttpClientFactoryForLnd.Generate(tlsCertificate, grpcMacaroon);
|
var clientWithNoMacaroonsTls = tlsCertificate == null || grpcMacaroon == null;
|
||||||
var httpClient = new HttpClient();
|
|
||||||
|
var httpClient = clientWithNoMacaroonsTls ? new HttpClient() :
|
||||||
|
HttpClientFactoryForLnd.Generate(tlsCertificate, grpcMacaroon);
|
||||||
|
|
||||||
return new LndSwaggerClientCustomHttp(uri.ToString().TrimEnd('/'), httpClient);
|
return new LndSwaggerClientCustomHttp(uri.ToString().TrimEnd('/'), httpClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue