ruby - Rails: local server handling SSL -


i'm surprised find such little documentation on topic quite many developers must have faced before me.

we're changing our app 100% https/ssl (as partial ssl doesn't make sense).

that's cool before that, need migrate it, hence test it. of course found basic information (here , here).

as i'd local environment close possible other ones in order avoid unexpected errors, solutions not satisfying me : ok short time testing feature, not more.

here problems/questions have:

  • can valid certificate local machine, avoid ugly warning step can't accept definitively on chrome?
  • booting server thin (thin start --ssl --ssl-verify --ssl-key-file server.key --ssl-cert-file server.crt), can same log messages rails server?
  • can't keep using rails server booting command (except writing dirty alias ...)

summary question can make config transparent run instance of our app locally in https?

i mean, absolutely everything's done in rails make development easy, , production robust, here, there such lack of tools? hardly can believe ... or let's now!

thanks support! i'm using rails 3.2 ruby 1.9.

can valid certificate local machine, avoid ugly warning step can't accept definitively on chrome?

this depends if you're using actual certificate domain (eg. example.com), or generating 1 development. if using actual certificate production, edit hosts file have example.com resolve localhost. visiting https://example.com should load rails app.

you'll need include in application.rb:

config.force_ssl = true 

if you're generating own certificate you'll need go through motions of creating private certificate authority avoid ssl warning in chrome. lot more work , not worth it.

booting server thin (thin start --ssl --ssl-verify --ssl-key-file server.key --ssl-cert-file server.crt), can same log messages rails server?

you should able tail -f log/development.log root of rails app.

can't keep using rails server booting command (except writing dirty alias ...)

this 1 trickier server runs when using rails s webbrick. try what's listed in post here: configuring webrick use ssl in rails 4


as aside typical setup rails app proxy behind ssl terminated nginx server. way rails app doesn't need know ssl, giving number of other benefits being able serve assets nginx, load-balancing, virtual hosts etc.

if you're interested in setting environment identical production i'd vagrant.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -