rvm single user installation fails with: curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You want to install rvm as a single user in a new linux but when trying to install it with the normal installation instruction:

it fails with the following error:

Solution

You are behind a proxy server and you need to setup your environment variables for the server in your .profile file like the following (and make sure you source the file afterwards with . ~/.profile):

Cucumber testing and ssl

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

Your application is ussing force_ssl to redirect all calls to ‘https’, but when you try to use your cucumber tests they fail.

Solution

By using the suggestion here, you can add a file in your initializers to bypass the ssl in development and test environment as follows:

SSL testing in rspec

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You have added the force_ssl option in your rails application, and the rspec tests fail with a redirection as ssl is required in the test evnironment.

Solution
Using a solution provided here you can add the following to your rspec test to ensure that ssl is used and the tests pass:

Apache rewrite rule to redirect https to http for pages you don’t need https

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You are using your Rails 3.2.x application with Apache and you have setup force_ssl in one of your controllers (ie payments), that you want to force the application to use ssl. But after you set it up, and you go to one of the actions for that controller, every subsequent page you follow still uses the https protocol, even if you don’t want them to.
So you need a way to force the serving of pages in http.

Solution

You can use a redirection in your SSL apache conf file, and specify that when it doesn’t match the sections (controller,actions) you specify it should be redirected to http.
Note that RewriteCond in Apache are by default ANDed when they are in subsequent lines so you can add more conditions and that you can use [OR] if you want to perform an OR logic operation.
So by adding the following in your virtual host for the 443 port (ssl), and apply the changes it should be working as expected: