Bitcoin Forum

Bitcoin => Electrum => Topic started by: Geremia on December 16, 2021, 08:02:17 PM



Title: cryptographic handshake: peer closed connection (wrong key?).
Post by: Geremia on December 16, 2021, 08:02:17 PM
I'm trying to connect to my local Electrum lightning node using c-lightning (https://github.com/ElementsProject/lightning), but why do I get this error:
Code:
All addresses failed: 127.0.0.1:9735: cryptographic handshake: peer closed connection (wrong key?). 
?


Title: Re: cryptographic handshake: peer closed connection (wrong key?).
Post by: jackg on December 16, 2021, 08:23:36 PM
Have you tested if clightning can connect to other nodes and open channels? Have you made an address in clightning?

Does the node appear via your peer discovery in electrum or did you input it manually? (im assuming you're trying to open a channel from electrum to the clightning client also as I'm not sure if it's as easy to do one the other way).



Title: Re: cryptographic handshake: peer closed connection (wrong key?).
Post by: nc50lc on December 17, 2021, 02:57:36 AM
Is "Use trampoline routing (disable gossip)" setting in Electrum enabled?
It can be found in "Tools->Preferences->'Lightning' tab" of the GUI or the "use_gossip": true, line of the config file.

If that's enabled, you wont be able to connect to any lightning nodes other than the (currently) 3 hardcoded Electrum trampoline nodes.


Title: get Electrum onion address?
Post by: Geremia on December 17, 2021, 04:14:27 AM
It seems I'm having an address issue.

Is there a way to determine what Electrum's onion address is so I can pass that to c-lightning in <pubkey>:<address>:<port> format?


Title: Re: cryptographic handshake: peer closed connection (wrong key?).
Post by: Rath_ on December 17, 2021, 11:10:38 PM
Is there a way to determine what Electrum's onion address is so I can pass that to c-lightning in <pubkey>:<address>:<port> format?

You could try connecting to your c-lightning node from Electrum. Open the console and type in:

Code:
add_peer("id@ip_address of your c-lightning node")

Code:
nodeid()

Copy the output and use it in the lightning-cli openchannel command.


Title: Re: cryptographic handshake: peer closed connection (wrong key?).
Post by: Pmalek on December 19, 2021, 08:24:43 AM
The "cryptographic handshake" error appears in a few GitHub issues. Here is one such example where the --bind-addr flag command was missing in the container. The user there had a problem to connect two of his nodes (one to the other). Check it out, maybe it can help > https://github.com/ElementsProject/lightning/issues/2337.