`http.use_ssl = uri.scheme == 'https'`

That's actually what ruby 2+ does internally.