Vivaswan Vivaswan - 5 months ago 28
Ruby Question

Could not find a valid gem 'rhc'. SSL_connect server certificate verify failed on Windows, Unable to connect OpenShift Server

C:\>gem install rhc

ERROR: Could not find a valid gem 'rhc' (>= 0), here is why:
Unable to download data from - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (

tried with the following commands:

gem sources -r
gem sources -a

But still same error exists when trying to setup rhc.

rhc setup

By following these steps rhc gem is installed successfully, but when executing "rhc setup" for connecting to openshift here is the error message rather connecting to openshift server

enter image description here


The problem is that your Windows machine does not recognize the rubygems server certificate as a trusted certificate because Windows don't have its authority certificate present in its trusted certs store.

As a quick fix you'd need to remove the HTTPS version of the rubygems source URL (not HTTP as you did):

gem sources -r

This quick fix should make rubygems use the HTTP version which has no certificate checks involved.

But this should not be the definitive fix. Instead you should add the HTTPS source back (using the -a option) and install a proper CA certificate for the rubygems server cert into your windows trusted CA certs store.

There are quite a few pages that deal with this procedure on the net (google this), e.g. the post here has steps to download and install all CA certificates from the curl command, to your Windows machine, that fixes the problem permanently and without lowering security.