We've had better luck with the faraday gem instead of raw net/http.  It's what's driving octokit underneath.