Read more

Local development with SSL and Puma

Daniel Straßner
August 18, 2022Software engineer at makandra GmbH

Sometimes the need arises for SSL in local development. We have guides for different webservers, this one is for puma.

  1. make sure mkcert is installed

  2. create an SSL certificate for localhost with mkcert:

$ mkcert-v1.4.4-linux-amd64 localhost
Created a new local CA 💥
...
  1. use the certificate in the Puma config config/puma.rb:
localhost_key = "#{File.join('localhost-key.pem')}"
localhost_crt = "#{File.join('localhost.pem')}"

ssl_bind '0.0.0.0', 3000, {
  key: localhost_key,
  cert: localhost_crt,
  verify_mode: 'none'
}
  1. start your server as usual, but go to https://localhost:3000
bundle exec rails s
  1. Accept the certificate in your browser
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot
Posted by Daniel Straßner to makandra dev (2022-08-18 09:23)