Closed oleonardolima closed 1 month ago
Good research on this issue. Even if we only get 1 and 2 above done that's a good start. From what I can gather from the other issues you listed rustls
is somehow more strict than openssl on how self signed certs need to be created.
wanted to come here to 👍 this issue as well because we've had a few customers run into this.
I think I've partially found a solution for the issue, at least to work with blockstream's electrum. We're using the custom implementation of rustls::client::danger::ServerCertVerifier
trait in a weird way, using a better way as shown in their examples and documentation it works with blockstream's electrum.
However, it still does not work with the custom electrum server mentioned by pythcoiner in the issue, but it gives now a better error w.r.t to the certificates, but I think it's solvable. I'll open the candidate PR soon (after BitDevs).
I think I've partially found a solution for the issue, at least to work with blockstream's electrum. We're using the custom implementation of
rustls::client::danger::ServerCertVerifier
trait in a weird way, using a better way as shown in their examples and documentation it works with blockstream's electrum.However, it still does not work with the custom electrum server mentioned by pythcoiner in the issue, but it gives now a better error w.r.t to the certificates, but I think it's solvable. I'll open the candidate PR soon (after BitDevs).
If users want to use a self signed certificates they would need to use it with Version 3, which is not the case for the one from pythcoiner.
Describe the enhancement
It has been noticed both in CI tests, which currently rely on blockstream's electrum client, and by other users in https://github.com/bitcoindevkit/bdk/issues/1598 and https://github.com/wizardsardine/liana/issues/1300 that the
electrum-client
does not properly connect to electrum servers with self-signed certificates while using thevalidate_domain: false
settings, and neither returns a proper and clear regarding the problem. There is some issue when using therustls
crate that it fails for self-signed certificates, on other handopenssl
works just fine.Therefore, I'm creating this issue mainly for two purposes:
validate_domain: false
, when using eitheropenssl
andrustls
with it's expected behavior.rustls
custom certificate validation.Use case
Allow users to properly use and connect electrum servers with self-signed certificates, either with `openssl` or `rustls`. **Additional context** https://github.com/rustls/rustls/issues/124 https://github.com/lightningnetwork/lnd/issues/5450 https://github.com/rigelminer/rigel/issues/130