-
Notifications
You must be signed in to change notification settings - Fork 70
fix load the SSL key as certificate and add documentation about generate keys #410
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
Conversation
|
ACK. That was a nice catch! |
|
I think it's worth it remove the This way we won't have the same difficulty figuring out what is wrong |
|
I can help you with that if needed @qlrd |
72fd1f1 to
5f0e82c
Compare
|
@lucad70, just learned about Can you review? |
|
Changed some documentation to $> florestad --help
...
...
--ssl-cert-path <PATH>
Path to the SSL certificate file (defaults to <data-dir>/ssl/cert.pem).
The user should create a PKCS#8 based one with openssl. For example:
openssl req -x509 -new -key key.pem -out cert.pem -days 365 -subj "/CN=localhost"
--ssl-key-path <PATH>
Path to the SSL private key file (defaults to <data-dir>/ssl/key.pem).
The user should create a PKCS#8 based one with openssl. For example:
openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:2048
... |
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.
utACK 6bb5937
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.
The error handling has improved massively, but you need to update the method call to correctly display it to the user. I suggest on letting it pass even with error and fixing the no_ssl logic on a followup PR as it would touch other parts of the code. However, other more experienced devs might add their own thoughts to it.
4bedee3 to
eaaafdb
Compare
…ut generate keys. The florestad/src/florestad.rs::create_tls_config function was loading the SSL key as certificate and not as a key due to the the variable `key_path` wrongly loading it as `self.config.ssl_cert_path` (and not as `self.config.ssl_key_path`). So, this commit: * Add a docstring in both florestad.rs and cli.rs with the steps to create the SSL private key and the certificate file; * correctly load the SSL private key file as a private key; * agnostically build paths to those files in a way that both UNIX and Windows will accept; * make a proper error handling/error-ing; * warn the user when florestad cannot load TLS (files does not exist, bad format, corrupted, or any reason of failure); * fixed the "always log but may never listen" bug when not find a valid SSL files (Davidson diff applied). remove diff
|
ACK b094d7b |
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.
ACK b094d7b
fix #409.
What is the purpose of this pull request?
Which crates are being modified?
Description
The
florestadwas loading the SSL key as certificate and not as a key due to the variablekey_pathload it asself.config.ssl_cert_pathand not asself.config.ssl_key_path.This commit fix this and also add a little docstring to indicate the user/developer how to generate them (supposed) correctly.
Notes to the reviewers
@lucad70 helped, personally, with the process (he found the issued function while helped him search another bug in Feat/enable backfill #215). Working together was amazing experience.
Also, some deepseek help that have nice comments:
Checklist
just lintcargo test