Skip to content

Commit ac80f9f

Browse files
committed
expose validate_domain config in electrum constructor
1 parent a5918b0 commit ac80f9f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

bdk-ffi/src/electrum.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,15 @@ pub struct ElectrumClient(BdkBdkElectrumClient<bdk_electrum::electrum_client::Cl
2929
impl ElectrumClient {
3030
/// Creates a new bdk client from a electrum_client::ElectrumApi
3131
/// Optional: Set the proxy of the builder
32-
#[uniffi::constructor(default(socks5 = None))]
33-
pub fn new(url: String, socks5: Option<String>) -> Result<Self, ElectrumError> {
32+
/// Optional: Set `validate_domain` to `false` to allow self-signed SSL certificates
33+
#[uniffi::constructor(default(socks5 = None, validate_domain = true))]
34+
pub fn new(
35+
url: String,
36+
socks5: Option<String>,
37+
validate_domain: bool,
38+
) -> Result<Self, ElectrumError> {
3439
let mut config = bdk_electrum::electrum_client::ConfigBuilder::new();
40+
config = config.validate_domain(validate_domain);
3541
if let Some(socks5) = socks5 {
3642
config = config.socks5(Some(bdk_electrum::electrum_client::Socks5Config::new(
3743
socks5.as_str(),

0 commit comments

Comments
 (0)