Which certs/key use for node tls

I’m using nodejs and tls.createSecureContext, this accepts a key, cert, and array of ca values.

The data I get from creating a certificate is cert, privkey, chain, key, ca. I’ve tried a few variations, but not sure if I’m using the right key or the right values. Would anyone know this should be setup?

What software are you using to create a certificate, and in what context are you using the tls.createSecureContext?

If I assume you are using Certbot, and are using tls.createSecureContext to start a standard HTTPS server, you’ll want to use:

key: /path/to/privkey.pem,
cert: /path/to/fullchain.pem

You don’t need to set the ca options unless you are acting as a TLS client and need to validate server certs, or if you are expecting clients to authenticate to you (in which case a Let’s Encrypt certificate is not the right thing).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.