-
Notifications
You must be signed in to change notification settings - Fork 296
Closed
Description
At the moment, we have three big issues communicating between go-libp2p and a browser:
- We can't dial them.
- We have to do our crypto in javascript.
- If the dApp is running in a secure origin, the go-libp2p node needs a valid TLS certificate for a valid domain.
However, it turns out that WebRTC already has built-in support for both encryption and multiplexing. Even better, the browser APIs allow the user to get the local and remote certificates of a connection (and their fingerprints).
Given this, we should be able to:
Setup
- Generate a certificate.
- Get the certificate's fingerprint.
- Sign this fingerprint using the libp2p peer key to generate a "peer cert"
Connection Establishment
- Create a connection with the certificate.
- Open a data stream.
- Send the "peer cert".
- Wait for the other side to do the same.
- Get the remote peer's TLS certificate.
- Check the remote endpoint's "peer cert".
Unfortunately, Firefox and Safari still need to implement https://www.w3.org/TR/webrtc/#dom-rtcdtlstransport-getremotecertificates.
fusetim, tomaka and melekes
Metadata
Metadata
Assignees
Labels
No labels