Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

electrum: fail to connect to a server w/ a self-signed certificate #1300

Open
pythcoiner opened this issue Sep 9, 2024 · 5 comments
Open

Comments

@pythcoiner
Copy link
Collaborator

pythcoiner commented Sep 9, 2024

we actually fails to connect (in ssl) to an electrum server that have a self-signed certificate, in order to allow it we should have a look to few points:

  • add an option to installer/settings to allow user to disable the certificate check, we should keep the default behaviour to check the certificate.
  • certificate check should be disabled if we set electrum_client::Config validate_domain to false but not works as intended if electrum_client is used w/ default use-rusttls feauture. It works fine w/ use-openssl feature btw.
    ( i've opened an issue about this disrepancy in bdk repo)
  • bdk_electrum crate does not offer use-openssl feature:
    Updating crates.io index
      Adding bdk_electrum v0.17.0 to dependencies
             Features:
             + use-rustls
             - use-rustls-ring

bdk_electrum Cargo.toml:

[dependencies]
bdk_core = { path = "../core", version = "0.1" }
electrum-client = { version = "0.21", features = [ "proxy" ], default-features = false }

[dev-dependencies]
bdk_testenv = { path = "../testenv", default-features = false }
bdk_chain = { path = "../chain", version = "0.18.0" }

[features]
default = ["use-rustls"]
use-rustls = ["electrum-client/use-rustls"]
use-rustls-ring = ["electrum-client/use-rustls-ring"]
@pythcoiner pythcoiner changed the title electrum: fail to connect to a server w/ a self sign certificate electrum: fail to connect to a server w/ a self-signed certificate Sep 9, 2024
@nondiremanuel nondiremanuel added this to the v8 - Liana milestone Sep 16, 2024
@nondiremanuel
Copy link
Collaborator

As per what we were saying in the chat, we should be able to do it after the bump of BDK version (https://github.com/wizardsardine/liana-backend/pull/233).

Let's also remember to edit back the error message we are going to insert with #1342

@pythcoiner
Copy link
Collaborator Author

i'm really not sure upgrading bdk solve our issue, the issue seems related to rust-tls, and the bdk client does not reexport the ssl feature that seems the only actual way to make it work w/ self-signed certificate

@evanlinjin
Copy link

evanlinjin commented Sep 20, 2024

You don't need bdk_electrum to reexport features. You can just add another dependency to liana's Cargo.toml file.

electrum-client = { version = "0.21.0", features = ["use-openssl", "proxy"] }

@oleonardolima
Copy link

@pythcoiner I have a candidate fix in bitcoindevkit/rust-electrum-client#150 in case you'd like to take a look.

@pythcoiner
Copy link
Collaborator Author

i'll review it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

4 participants