Skip to content

Commit

Permalink
chore: add support for SERVER_SSL_CA
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken committed Jun 21, 2024
1 parent 56fd7e8 commit 5e66597
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const envSchema = z.object({
SERVER_SSL_ENABLED: zBoolean("false"),
SERVER_SSL_CERT: z.string().optional(),
SERVER_SSL_KEY: z.string().optional(),
SERVER_SSL_CA: z.string().optional(),
TRUST_PROXY: zBoolean("false"),
SELF_MONITORING: zBoolean("false")
});
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ const serverOptions = {
https: env.SERVER_SSL_ENABLED ?
{
key: readFileSync(env.SERVER_SSL_KEY!, "utf-8"),
cert: readFileSync(env.SERVER_SSL_CERT!, "utf-8")
cert: readFileSync(env.SERVER_SSL_CERT!, "utf-8"),
ca: typeof env.SERVER_SSL_CA === "string" ? readFileSync(env.SERVER_SSL_CA, "utf-8") : void 0
} :
null,
disableRequestLogging: true,
Expand Down
1 change: 1 addition & 0 deletions src/modules/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const envSchema = z.object({
SERVER_SSL_ENABLED: zBoolean("false"),
SERVER_SSL_CERT: z.string().optional(),
SERVER_SSL_KEY: z.string().optional(),
SERVER_SSL_CA: z.string().optional(),
TRUST_PROXY: zBoolean("false"),
SELF_MONITORING: zBoolean("false")
});
Expand Down

0 comments on commit 5e66597

Please sign in to comment.