“Every day you want to scream,” says General Stanley McChrystal about the crisis that ended his career. Still recovering, he has turned  trauma into a leadership lesson.

It’s easy to be a leader when things are going well. The true test comes when things fall apart. How do you handle yourself then?

General Stanley McChrystal delivered very personal wisdom at Fortune Brainstorm Tech in Aspen on Tuesday during a “Lessons in Leadership” session that also included Hewlett-Packard EVP Todd Bradley. McChrystal was the commander of U.S. troops in Afghanistan in 2010 when a Rolling Stone profile portrayed him and his aides as contemptuous of the President. The story, which McChrystal says was inaccurate, led him to resign and end his military career.

The four-star general’s reinvention now has him  leading the McChrystal Group, a consulting firm that helps companies like HP change the ways they operate. While dispensing plenty of leadership advice, the gem of this session, which  I moderated, was McChrystal’s stunning candor–speaking as he has not before about his crisis, the lesson from it, and the approach any of us might take to gain strength from an embarrassing setback.

“Well, I decided to myself, that that was an inflection point in my life. And I couldn’t change that now. You can’t change the past. 

And what I was going to try to do is conduct myself every day for the rest of my life in a way that would cause anybody who saw or dealt with me to say, “That’s not congruent with the tone of that report.”

So, rather than take on the report directly, I decided to take it on indirectly and just try to disprove it by my conduct.

You pay a big price when you do that. Silence hurts. When you keep your mouth shut and you don’t write about it, you don’t talk about it, and every day you want to scream.

You want to scream out every day—a little less every day, but every day you do.

Most leaders go through something like that…Get yourself ready to what’s important to you: What’s the core of you? What can’t people take away from you?
And realize that if you give to other people the opportunity to determine your dignity or your sense of self-worth—if you outsource that to them—they can leave you in a bad place.

So you’ve got to decide.

Here’s the full interview with McChrystal and HP’s Bradley. Fast-forward to 44:00 to see McChrystal talking about his career crisis.