Prevent server crash when SSL certificate is missing or invalid #1443
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_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: