Simpler run configurations without config file + tls instructions
colemickens opened this issue · 3 comments
colemickens commented
binserve seems really great but I really wish it were a bit easier to use:
- It would be really great to be able to just do
binserver --auto-self-signed-tls --dir ./www
and have it generate a self-signed key/cert and serve from the directory. - I have no idea how to generate certs/keys for this. I have my openssl one-liner and if I try to use that I get:
[cole@slynux:~/code/webrtcsink]$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365
redacted....
[cole@slynux:~/code/webrtcsink]$ binserve
[INFO] Build finished in 485 μs ⚡
[INFO] Enabled TLS (HTTPS) 🔒
[SUCCESS] Your server is up and running at 0.0.0.0:8001 🚀
[ERROR] Could not locate PKCS 8 private keys.
colemickens commented
It seems like if I convert the PEM key like this, it will work:
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in key.pem -out key8.pem
and switching the key file to point to key8.pem
of course.
colemickens commented
#33 helps with this by adding basic openssl generation docs
mufeedvh commented
Hey @colemickens, thank you so much for opening this issue and the PR. I should've added more details on the TLS part.
I will use this as a tracking issue to add --auto-self-signed-tls --dir ./www
options/feature so it would be a lot easier, thanks for the idea! 🙌