Skip to content

Instantly share code, notes, and snippets.

@narze
Created June 21, 2018 11:29
Show Gist options
  • Save narze/e83f23dacfee406222e58ed9b3093108 to your computer and use it in GitHub Desktop.
Save narze/e83f23dacfee406222e58ed9b3093108 to your computer and use it in GitHub Desktop.
Self-signed certificate SSL with puma on localhost
# 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