Many, in their readings of Civil Disobedience have seen the refuals by Thoreau to pay his taxes as a protest against the Mexican War and fail to see anything further in the passages. Others see just the issue of the slavery. Thoreau was protesting the Mexican War (which he saw as an extension of slavery) and slavery itself. Civil Disobedience was published in 1849, 11 years before the Civil War.

Selected Passages:

There are thousands who are in opinion opposed to slavery and to the war, who yet in effect do nothing to put an end to them; who, esteeming themselves children of Washington and Franklin, sit down with their hands in their pockets, and say that they know not what to do, and do nothing;

When the majority shall at length vote for the abolition of slavery, it will be because they are indifferent to slavery, or because there is but little slavery left to be abolished by their vote.

If I have unjustly wrested a plank from a drowning man, I must restore it to him though I drown myself. This, according to Paley, would be inconvenient. But he that would save his life, in such a case, shall lose it. This people must cease to hold slaves, and to make war on Mexico, though it cost them their existence as a people.

I have heard some of my townsmen say, "I should like to have them order me out to help put down an insurrection of the slaves, or to march to Mexico - see if I would go"; and yet these very men have each, directly by their allegiance, and so indirectly, at least, by their money, furnished a substitute. The soldier is applauded who refuses to serve in an unjust war by those who do not refuse to sustain the unjust government which makes the war;

It is plain from these quotes that Henry David Thoreau was opposed to both slavery and the war in Mexico, and speaks out against both in Civil Disobedience.