Skip to content

Fix SSL certificate loading to gracefully fall back to HTTP#2

Open
railway-app[bot] wants to merge 1 commit into
mainfrom
railway/code-change-qJlKtZ
Open

Fix SSL certificate loading to gracefully fall back to HTTP#2
railway-app[bot] wants to merge 1 commit into
mainfrom
railway/code-change-qJlKtZ

Conversation

@railway-app
Copy link
Copy Markdown

@railway-app railway-app Bot commented May 25, 2026

Problem

When SSL_CONF_PRIVKEY or SSL_CONF_FULLCHAIN are empty strings, the https getter in src/utils/server-up.ts passes them directly to fs.readFileSync(), which fails and causes the server to crash on startup with "Cannot read properties of undefined (reading 'listen')".

Solution

Added a guard in the https getter that returns null if either FULLCHAIN or PRIVKEY is falsy. The caller in main.ts already has a server === null check that logs a warning and falls back to HTTP, so no changes were needed there.

Changes

  • Modified src/utils/server-up.ts

Generated by Railway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants