How do you handle SSL in development?

前端 未结 2 1018

I have an application that uses HTTPS for some of its routes in conjunction with the ssl_requirement plugin. It\'s deployed and is working fine in production.

The questi

2条回答
  •  一个人的身影
    2021-02-03 10:58

    Don't worry about SSL in development

    For a development environment, IMO, you don't need to run SSL. It's not worth the time or hassle, especially as more people join the team. With regards to your routes, I would simply keep the protocol as http in the development environment:

    protocol = Rails.env.development? ? "http" : "https"
    
    map.resource :session, :controller => 'session',
                           :only => [:new, :create, :destroy],
                           :requirements => { :protocol => protocol }
    

    Now, where you do need to test your SSL integration is on your staging environment -- the place where you deploy to just prior to deploying to production. This is where you want to accurately replicate your production environment. Your development environment does not need to match your production environment in this same way.

提交回复
热议问题