bitcoindevkit / rust-electrum-client

Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers.
MIT License
78 stars 63 forks source link

Issue connecting to server with self-signed certificate #118

Open hisenb3rg opened 1 year ago

hisenb3rg commented 1 year ago

I'm using electrum-client through bdk-cli and trying to securely connect to local electrs with self-signed certificate. I have set the this certificate as trusted in system keystore, but it didn't help.

Is there an option (env var) to set the system keystore as CA store? Or any other way around this issue?

Here's the log output from bdk-cli:

[2023-09-21T19:09:49Z INFO  electrum_client::client] Succesfully created new client
[2023-09-21T19:09:49Z DEBUG rustls::client::hs] Using ciphersuite TLS13_AES_256_GCM_SHA384
[2023-09-21T19:09:49Z DEBUG rustls::client::tls13] Not resuming
[2023-09-21T19:09:49Z DEBUG rustls::client::tls13] TLS1.3 encrypted extensions: []
[2023-09-21T19:09:49Z DEBUG rustls::client::hs] ALPN protocol is None
[2023-09-21T19:09:49Z WARN  rustls::conn] Sending fatal alert BadCertificate
[2023-09-21T19:09:49Z WARN  electrum_client::client] call 'batch_script_get_history' failed after 6 attempts
[2023-09-21T19:09:49Z ERROR bdk_cli] Electrum client error: Made one or multiple attempts, all errored:
        - invalid peer certificate contents: invalid peer certificate: UnknownIssuer