Worker DTLS files best practices?

Any best practices in generating DTLS certificate and the private key files for worker?

const worker = await mediasoup.createWorker(
  {
    logLevel            : "warn",
    dtlsCertificateFile : "/home/foo/dtls-cert.pem",
    dtlsPrivateKeyFile  : "/home/foo/dtls-key.pem"
  });

Not the greatest with this context, I’d appreciate even specific to mediasoup server guidelines.

I see no reason to provide DTLS certificate over letting mediasoup generate a random one.

Nice! I removed the parameters and server started.
What about production? I assume I set to the certificate generated for the server.

EDIT: I might be confusing the DTLS certificate with the web server certificate and the above statement might be irrelevant.

You may want to use that to make mutual peer authentication, but you need to have control over certificates on both ends and there is no such API in the browser. Browsers and most other software (with some obscure exceptions) generate those automatically.
So unless you really know that you need it, just don’t bother and let server generate it for you automatically.

2 Likes

I’ll go with it, totally fine and thanks for the explanation :slight_smile: