Use HTTP auth if configured when checking for presence of API

If gem server uses HTTP auth set up in config file, API is not used. Instead the whole index of gem server is fetched.