-
Notifications
You must be signed in to change notification settings - Fork 11
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
HTTPS support #19
base: master
Are you sure you want to change the base?
HTTPS support #19
Conversation
I just realize that it is also possible to serve HTTPS without a certificate configured. However, not often practically useful (browsers block/alert users in this case, but can be useful for testing). Perhaps a bool |
Hi and thanks for the pull request! First there were some questions, I'll try to take them one by one first:
Second, let talk about the code. I'll split my thoughts up in two parts, regarding syntax and semantics. Syntax:
Semantics:
So, lots of comments, but overall I like your contribution, I hope you don't feel I'm offensive that is really not my intent here. I could clearly change some of the syntax things later but I thought it was better to just talk about it here instead of just merging and then change some of the code later. The semantic parts simply have to be fixed since they don't work as indented. Ps. I have not had the time to really try and run the code just yet, these comments are based on me just reading the code. If I'm wrong on something please feel free to correct me. Ds. |
That's a lot of text :)
sslCertificateDatabasePassword = sslCertificateDatabasePassword != null ? sslCertificateDatabasePassword : Platform.environment['SSL_CERT_DB_PASS'];
// or
if(sslCertificateDatabasePassword == null)
sslCertificateDatabasePassword = Platform.environment['SSL_CERT_DB_PASS'];
|
Aha, found |
I added support for HTTPS serving with certificates configured. It is possible to serve both HTTP and HTTPS or to automatically redirect HTTP requests to HTTPS.
I also added the possibility to define the host and ports to listen on using the parameters of serve instead of only using the environment.
This change should not introduce breaking changes to existing users.
Perhaps it is a good idea to allow users to pass the database password using an environment variable as well. I believe in that case the database files can be safely exposed, f.e. in a GitHub repo.