SSL_Connect Certificate Error with Ruby Fix

While setting up a static environment, I came across this error from running: gem install github-pages (a gem for syncing Jekyll with GitHub Pages):

Unable to download data from - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (

The problem came from outdated SSL certificates, as explained by Fletcher Nichol in this gist.

A solution was to temporarily replace the https source with http.

gem sources -r
gem sources -a
gem install github-pages

And then restore the SSL.

gem sources -r
gem sources -a

This was a quick fix, however, using http over https raised security concerns since http didn't include the SSL encryption when installing gems.

The solution:

  • Download the certificate authority cacert.pem file
  • Save it to the RailsInstaller folder located in the (C:)
  • Set an environment variable identifying the file path.

To set an environment variable:

Go to the Control Panel, System and Security, System, and Advanced System Settings. Click on Environment Variables...


Variable name: SSL_CERT_FILE

Variable value: SSL_CERT_FILE=C:\RailsInstaller\cacert.pem

Click OK, close the control panel and re-lanch the command line.

Following this, I was able to install github-pages with success, CD to my project folder and successfully run jekyll server --watch without error.