Skip to content

How to get the certhash for webrtc? #2406

Answered by achingbrain
Download asked this question in Q&A
Discussion options

You must be logged in to vote

certhash is the hash of the SSL certificate the listener is using to encrypt the connection and is not derived from the PeerId.

It's only used by the WebRTC Direct transport which is dial-only in browsers and not implemented in Node.js (the other flavour of WebRTC OTOH is implemented in browsers, node, electron, etc).

You should be able to obtain it from the multiaddr of the server, which you'd get by some out-of-band method.

Unfortunately the WebRTC readme was out of date and showed an example for WebRTC Direct but used a multiaddr with a webrtc protocol instead of webrtc-direct. I've updated it now, please open a PR if you think it can be improved further - https://github.com/libp2p/js-…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Download
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants