Created
June 21, 2018 11:29
-
-
Save narze/e83f23dacfee406222e58ed9b3093108 to your computer and use it in GitHub Desktop.
Self-signed certificate SSL with puma on localhost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Self sign | |
| openssl req -x509 -out tmp/localhost.crt -keyout tmp/localhost.key \ ✔ 6930 18:25:32 | |
| -newkey rsa:2048 -nodes -sha256 \ | |
| -subj '/CN=localhost' -extensions EXT -config <( \ | |
| printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") | |
| # Run puma directly instead of bin/rails server | |
| bundle exec puma -b 'ssl://localhost:3000?key=tmp/localhost.key&cert=tmp/localhost.crt' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment