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

Unable to dial bootstrap nodes InvalidKey #2971

Closed
dignifiedquire opened this issue Oct 3, 2022 · 3 comments · Fixed by #2972
Closed

Unable to dial bootstrap nodes InvalidKey #2971

dignifiedquire opened this issue Oct 3, 2022 · 3 comments · Fixed by #2972

Comments

@dignifiedquire
Copy link
Member

Summary

I just upgraded my fork to the current master, but am now getting the following error when dialing the boostrap nodes

 2022-10-03T18:33:11.985412Z DEBUG iroh_bitswap: dial failure QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb: Transport([("/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb", Other(Custom { kind: Other, error: Other(A(B(Apply(InvalidKey)))) }))])
    at iroh-bitswap/src/lib.rs:313

  2022-10-03T18:33:12.132196Z DEBUG iroh_bitswap: dial failure QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa: Transport([("/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa", Other(Custom { kind: Other, error: Other(A(B(Apply(InvalidKey)))) }))])
    at iroh-bitswap/src/lib.rs:313

  2022-10-03T18:33:12.279092Z DEBUG iroh_bitswap: dial failure QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN: Transport([("/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN", Other(Custom { kind: Other, error: Other(A(B(Apply(InvalidKey)))) }))])
    at iroh-bitswap/src/lib.rs:313

  2022-10-03T18:33:12.284856Z DEBUG iroh_bitswap: dial failure QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt: Transport([("/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt", Other(Custom { kind: Other, error: Other(A(B(Apply(InvalidKey)))) }))])

My current noise setup looks like this:

let dh_keys = noise::Keypair::<noise::X25519Spec>::new()
            .into_authentic(keypair)
            .expect("Noise key generation failed");

        noise::NoiseConfig::xx(dh_keys).into_authenticated()
@thomaseizinger
Copy link
Contributor

You are dialing RSA keys but probably have not enabled the rsa feature.

I gotten bitten by the same thing, the error message should really be better!

@dignifiedquire
Copy link
Member Author

Uff, can confirm that is the issue, but this is a pretty big footgun

@thomaseizinger
Copy link
Contributor

I am working on a patch to improve this situation :)

thomaseizinger added a commit that referenced this issue Oct 3, 2022
This should make for better error messages when support for certain
keys is disabled.

Fixes #2971.
@mergify mergify bot closed this as completed in #2972 Nov 23, 2022
mergify bot pushed a commit that referenced this issue Nov 23, 2022
In case support for e.g. RSA keys is disabled at compile-time, we will now print a better error message. For example:

> Failed to dial Some(PeerId("QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt")): Failed to negotiate transport protocol(s): [(/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt): : Handshake failed: Handshake failed: Invalid public key: Key decoding error: RSA keys are unsupported)]

Fixes #2971.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants