In Enemy Hands by David Weber
Honor Harrington has faced ship-to-ship combat, assassins, political vendettas and duels. She's been shot at, shot down, and just plain shot; had starships blown out from under her, and made personal enemies who will do anything to ruin her, and she's survived it all. Now she finds herself on board a battlecruiser bound for a prison planet aptly named 'Hell' - and her scheduled execution. Put into solitary confinement, separated from her officers and her treecat Nimitz, and subjected to systematic humiliation by her gaolers, her future has become both bleak and short. Yet the one lesson Honor Harrington has never learned is how to give up . . .