How to configure local SSL certificate and Rails application?

This may be a two to one question.

  • I have a Rails home / hobby application hosted on a Raspberry Pi and I was wondering if I could create a local SSL certificate for it and configure Rails to use it?

  • If so, how can I customize the Rails / Puma / Foreman / Ubuntu app? Right now I am running the application with Foreman using the Procfile file:

    web: bundle exec puma -t 8:8 -p 3000
    worker: bundle exec sidekiq
    clock: bundle exec clockwork config/clock.rb
    
+4
source share
2 answers
  • Yes, you can. Here is the point explaining the process:

https://gist.github.com/tadast/9932075

  1. My procfile contains an entry that looks like this:

    server: rails server puma -b 'ssl://0.0.0.0: 3000? key = server.key & cert = server.crt'

, .

config.force_ssl = true 

config/application.rb

:

https://github.com/puma/puma

http://www.railway.at/2013/02/12/using-ssl-in-your-local-rails-environment/

http://www.panozzaj.com/blog/2013/08/12/how-to-set-up-local-https-development/

http://www.eq8.eu/blogs/14-config-force_ssl-is-different-than-controller-force_ssl

+7

. ssl . -, nginx. 3.2. , 4 +.

-1

Source: https://habr.com/ru/post/1625823/


All Articles