Fixes FetchError when downloading from hosted gem server

This pull request is an attempt to fix issue 800.

https://github.com/rubygems/rubygems/issues/800