4 ms·
Asked for an HTTPS one liner on stackoverflow a while back and got this answer: ruby -r webrick/https -e ' WEBrick::HTTPServer.new( Port: 800
by scanr 7y ago
Asked for an HTTPS one liner on stackoverflow a while back and got this answer:
ruby -r webrick/https -e '
WEBrick::HTTPServer.new(
Port: 8000, DocumentRoot: ".",
SSLEnable: true, SSLCertName: [%w[CN localhost]]).start'
https://stackoverflow.com/a/37986354/59325 https://stackoverflow.com/a/37986354/59325
- avip 7y agoCaddy is brilliant for this task.
- divbzero 7y agoFor reference the HTTPS one-liner with Caddy [1] would be: caddy file-server --domain example.com And similarly for HTTPS reverse proxy: caddy reverse-proxy --from example.com --to localhost:9000 [1]: https://caddyserver.com/ https://caddyserver.com/ This plus hosts file can be a quick way to test secure cookies, secure headers, etc.
- rjeli 7y agoYou could also tunnel any of the http servers through socat ssl-l.
- Ded7xSEoPKYNsDd 7y agoopenssl can also do it. no dirlisting though. openssl req -x509 -newkey rsa:4096 -keyout /tmp/key.pem -out /tmp/cert.pem -nodes && openssl s_server -WWW -port 8443 -cert /tmp/cert.pem -key /tmp/key.pem