1girl, best quality1
Denoβ€’2y agoβ€’
1 reply
1girl, best quality

Is there an easy way to read tls certificate and key from a filesystem?

I do the following:
if (Deno.env.has("TLS_CERT_PATH") && Deno.env.has("TLS_PKEY_PATH")) {
  const tlsCert = Deno.readFileSync(Deno.env.get("TLS_CERT_PATH"));
  const tlsPkey = Deno.readFileSync(Deno.env.get("TLS_PKEY_PATH"));
  serverOptions = { cert: tlsCert, key: tlsPkey };
}

and it doesn't work because apparently it wants a string, not a uint8array. I don't know what's a good way to get a string from a uint8array or to read a string from fs.
Was this page helpful?