Changed to honor secureProtocol in order to avoid ECONNRESET when accessing older IIS with SSL