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 web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot
Posted by Daniel Straßner to makandra dev (2022-08-18 09:23)