Configuring node.js to Serve Certificates Correctly for Android Browsers

I’m using node.js and tls.createSecureContext. Only on Android devices do I seem to get this error. I tried using both chain and ca, but neither seem to fix this issue, in fact their both the same value. Any idea what how I can fix this?

Here’s is how I have it associated:

tls.createSecureContext({ key: response.key, cert: response.cert, ca: [response.ca] });

Thank you

I’ve seen some other similar posts referring to fullchain.pem. However, the responses I have are cert, privkey, chain, key, ca. ca and chain are the same value.

According to

https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options

you should concatenate the PEM certificates from the certificate and chain into a single string, and then pass that to createSecureContext as the value of cert. The ca option is for something entirely different and shouldn't be used in this context.

One cert chain should be provided per private key. Each cert chain should consist of the PEM formatted certificate for a provided private key, followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA

The intermediate certificate is the same as the chain certificate (currently consisting of the Let's Encrypt X3 cert which is issued and signed by IdenTrust).

1 Like

Ah perfect, thanks very much, that works!

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