-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Prevent server crash when SSL certificate is missing or invalid #1443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Reviewer's GuideIntroduces a resilient HTTPS setup by catching certificate load errors to avoid crashes, implements a fallback to HTTP with user-friendly warnings, and updates the example environment file with the required SSL configuration variables. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Link33d - I've reviewed your changes - here's some feedback:
- Rather than silently swallowing all errors in the
https
getter, consider logging the specific certificate-loading error so users have more context on why the fallback occurred. - Instead of mutating
httpServer.TYPE
to switch back to HTTP, use a local fallback variable to avoid side effects on the shared config object.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Problem Description:
I was setting up my Evolution server for the first time. Everything went smoothly, and I was able to run it successfully. However, I ran into an issue when trying to configure the server to use HTTPS.
After changing the
SERVER_TYPE
environment variable tohttps
, I encountered the following error in the console:After some research, I realized that the error was caused by a missing or invalid SSL certificate. I spent quite a bit of time trying to figure out which environment variables were required to define the certificate paths properly. I ended up digging into the source code to find out.
Once I set the correct variables, the HTTPS server worked as expected.
Motivation for this pull request:
I’m submitting this PR with a few improvements to make this process easier for future users:
SSL_CONF_PRIVKEY
andSSL_CONF_FULLCHAIN
) to the.env.example
file, so users don’t need to search through the code or documentation to find them.Summary by Sourcery
Catch errors when loading SSL certificates to prevent server crashes, automatically fall back to HTTP with clear console warnings, and document required SSL environment variables.
Bug Fixes:
Enhancements:
Documentation: