Skip to content

Commit

Permalink
fix(ssl): read cert/key with readFileSync
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken committed Apr 8, 2024
1 parent 614958f commit 69b6b39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Import Node.js Dependencies
import { readFileSync } from "node:fs";

// Import Third-party Dependencies
import { TimeStore } from "@openally/timestore";

Expand All @@ -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: {
Expand Down

0 comments on commit 69b6b39

Please sign in to comment.