Test connection before authentication