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

Lacking Documentation: certhash for webRTC? #2438

Closed
sleep9 opened this issue Mar 12, 2024 · 1 comment
Closed

Lacking Documentation: certhash for webRTC? #2438

sleep9 opened this issue Mar 12, 2024 · 1 comment
Labels
need/triage Needs initial labeling and prioritization

Comments

@sleep9
Copy link

sleep9 commented Mar 12, 2024

I am trying to establish a direct webRTC connection to a server (which is also a circuit relay server) but documentation is lacking on how to derive the certhash from a pem self signed certificate. I can establish RTC connection to another client connected to the server but cannot open a connection to the server itself, I can only speculate that it is due to lacking a listen address which requires a certhash.

See this discussion for more information #2406

  • Platform:
    Node.js 20.11.1 - webrtc server
    React Native 0.72.6 - webrtc client
    Node.js 20.11.1 - webrtc client

  • Subsystem:
    webRTC

Severity:

Low

@sleep9 sleep9 added the need/triage Needs initial labeling and prioritization label Mar 12, 2024
@achingbrain
Copy link
Member

There are two flavours of WebRTC in libp2p - WebRTC and WebRTC Direct.

certhash is only used by WebRTC Direct which is dial-only in browsers and unimplemented in Node.js.

To implement it, changes would be necessary in libdatachannel which would make the implementation more complicated - see paullouisageneau/libdatachannel#970

Node.js can listen on (and dial) a regular WebRTC address, but it requires a relay server to do the initial SDP handshake.

An alternative is to have Node.js listen on a WebSocket address, then it can be dialled from browsers.

The WebRTC transport readme was lacking docs for this - I've updated it, please take a look and open a PR if you think it can be improved - https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc#readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants