From 69b6b392e6fded892c37c8541012d36e61b6d750 Mon Sep 17 00:00:00 2001 From: fraxken Date: Mon, 8 Apr 2024 14:44:17 +0200 Subject: [PATCH] fix(ssl): read cert/key with readFileSync --- src/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 7093b39..30f0f26 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,6 @@ +// Import Node.js Dependencies +import { readFileSync } from "node:fs"; + // Import Third-party Dependencies import { TimeStore } from "@openally/timestore"; @@ -16,7 +19,10 @@ const store = new TimeStore({ const serverOptions = { trustProxy: env.TRUST_PROXY, https: env.SERVER_SSL_ENABLED ? - { key: env.SERVER_SSL_KEY, cert: env.SERVER_SSL_CERT } : + { + key: readFileSync(env.SERVER_SSL_KEY!, "utf-8"), + cert: readFileSync(env.SERVER_SSL_CERT!, "utf-8") + } : null, disableRequestLogging: true, logger: {