Prevent server crash when SSL certificate is missing or invalid#1443
Closed
Link33d wants to merge 1 commit intoEvolutionAPI:developfrom
Closed
Prevent server crash when SSL certificate is missing or invalid#1443Link33d wants to merge 1 commit intoEvolutionAPI:developfrom
Link33d wants to merge 1 commit intoEvolutionAPI:developfrom
Conversation
Contributor
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
|
Contributor
There was a problem hiding this comment.
Hey @Link33d - I've reviewed your changes - here's some feedback:
- Rather than silently swallowing all errors in the
httpsgetter, consider logging the specific certificate-loading error so users have more context on why the fallback occurred. - Instead of mutating
httpServer.TYPEto 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.
Collaborator
|
implementado na develop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_TYPEenvironment 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_PRIVKEYandSSL_CONF_FULLCHAIN) to the.env.examplefile, 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: