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

Generate random Serial Number in DTLS cert #44

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Generate random Serial Number in DTLS cert #44

merged 2 commits into from
Jul 4, 2024

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented Jul 3, 2024

This should fix elixir-webrtc/ex_webrtc#127

Firefox requires two different peer connections to have unique (CN, SN) DTLS cert tuples OR if they are not unique, the whole cert has to be exactly the same. See here for more.

As a result, we cannot e.g. open multiple tabs in Reco or Broadcaster demo applications - only the first one will successfully establish a connection.

So far, we have been using the same CN and SN (because we are generating self-signed cert) but some implementations generate a random SN. See Mediasoup or Janus

We have two options:

  • allow to pass certificates to the PeerConnection and set the same cert for every PC across some service
  • generate random SN

The first option does not solve the problem when we want to run multiple ExWebRTC services simultanously - we would have to configure those services with the same DTLS key/cert pair which is inconvenient and insecure. Even using the same cert for two different PC in the same service isn't the best practice. Cert option in PC config was introduced because of slower devices where generating DTLS cert might take some time. In such case, DTLS cert can be generated upfront and used when needed.

@mickel8 mickel8 requested a review from LVala July 3, 2024 17:58
@mickel8 mickel8 merged commit f189242 into master Jul 4, 2024
2 checks passed
@mickel8 mickel8 deleted the random-sn branch July 4, 2024 11:15
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 this pull request may close these issues.

Firefox can't establish two simultanous peer connections with Elixir WebRTC
2 participants