I am using Ruby on Rails 3 and I would like to know some good advice in developing an application in localhost in order to make and prepare that for future deployment.
Specifically in this question I would like to know something about switching an SSL configuration from my computer to an hosting server.
In localhost I use a self-signed SSL certificate, so to run a HTTPS request I must disable its verification (see the below example), but what should I do when the application is deployed and I bought a SSL certificate?
If in localhost I have (using Typhoeus gem)
Typhoeus::Request.get("https://users.pjtname.com", :disable_ssl_peer_verification => true,)
What I will have to do on a hosting server side?
Have I just to delete the :disable_ssl_peer_verification => true code and then set for Typheous a proper certificate like the following or some other thing?
Typhoeus::Request.get("https://users.pjtname.com",
:ssl_cacert => "cacert.pem",
:ssl_capath => "/"
)
… and, at all, it will be difficult to switch this kind of configuration?
You could just do an environment check to run different setups, quick example:
Will disable peer verification if you are on the development environment, otherwise it will use the ssl_cacert and ssl_capath settings.