def connect
      http = Net::HTTP.new(host, port)
      http.use_ssl = ssl

      begin
        yield http
      rescue *HTTP_ERRORS => exception
        raise ConnectionError, "#{exception.class.name}: #{exception.message}"
      end
    end
def connect
      http = Net::HTTP.new(host, port)
      http.use_ssl = ssl

      begin
        yield http
      rescue *HTTP_ERRORS => exception
        raise ConnectionError, "#{exception.class.name}: #{exception.message}"
      end
    end
Internal: Creates a Net::HTTP connection and yields to a block with
 the connection.

 Yields the Net::HTTP connection.

 Returns the return value (if any) of the block.
 Raises ConnectionError if any common HTTP errors are raised.