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

bug: wakucanary requires key path to test client connections #2349

Closed
felicio opened this issue Jan 11, 2024 · 7 comments · Fixed by #2408
Closed

bug: wakucanary requires key path to test client connections #2349

felicio opened this issue Jan 11, 2024 · 7 comments · Fixed by #2408
Assignees
Labels
bug Something isn't working status-waku-integ All issues relating to the Status Waku integration.

Comments

@felicio
Copy link

felicio commented Jan 11, 2024

Problem

The wakucanary requires --websocket-secure-key-path to test client connections.

Expected behavior

The flag should not be required.

Additional context

Why

@felicio felicio added the bug Something isn't working label Jan 11, 2024
@chair28980 chair28980 added the status-waku-integ All issues relating to the Status Waku integration. label Jan 16, 2024
@chair28980
Copy link
Contributor

Related to #1732

@felicio
Copy link
Author

felicio commented Jan 16, 2024

@chair28980 please, what's the "Icebox" status and is there any chance to give this a higher prio? Given https://github.com/status-im/infra-hq/issues/92#issue-1769478385.

@chair28980
Copy link
Contributor

Cc @waku-org/nwaku-developers please see above

@gabrielmer gabrielmer self-assigned this Feb 8, 2024
@gabrielmer
Copy link
Contributor

As discussed, WSS is not defined as a client-server protocol (even more with the P2P case), so it's reasonable that nim-libp2p requires certificates to establish a connection.

The proposed solution is for WakuCanary to generate self signed certificates in case none is provided and establish the connection.

CC @jakubgs @vpavlin

@jakubgs
Copy link
Contributor

jakubgs commented Feb 8, 2024

WSS is not defined as a client-server protocol

What? I'm sorry but I'm confused. My understanding is that Secure WebSockets, or wss:// protocol is just WebSockets over TLS, right? Which means that the connection starts through a TLS(HTTPS) handshake, which is a client-server protocol, and does not require a certificate on the client side.

If you're saying I can just use any "snakeoil" certificate and key with the Waku canary for wss:// connections then that's fine, we can do that, but I would like to understand what is actually happening here. Clearly the TLS handshake does not require a certificate on the client side, so where does the need for the certificate on client side come in?

@gabrielmer
Copy link
Contributor

If you're saying I can just use any "snakeoil" certificate and key with the Waku canary for wss:// connections then that's fine, we can do that, but I would like to understand what is actually happening here. Clearly the TLS handshake does not require a certificate on the client side, so where does the need for the certificate on client side come in?

Yes, apologies, my previous comment wasn't really accurate 😶

So the way Waku Canary works is creating a Waku node, adding the node we want to check as a peer, connecting to it and verifying which protocols it supports.

If we would try to connect to the node via a "normal" WSS client and not via a libp2p node, then we wouldn't need the certificate. But because we do it via a libp2p node, which requires a certificate in order to use WSS as it's not designed for client-server use cases, we need the certificate. The requirement comes from here: https://github.com/status-im/nim-libp2p/blob/unstable/libp2p/transports/wstransport.nim#L324

@jakubgs
Copy link
Contributor

jakubgs commented Feb 9, 2024

I see, thanks for explaining the confusion. So we can just generate any certificate and key for the canary host and use that for all canaries checking websocket port status. Cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status-waku-integ All issues relating to the Status Waku integration.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants