handle a NULL hostname in cli_connect()