I think that to be confident, you have to be a little bit clueless about the social world. The really confident people I know tend to assume that everyone loves them, and that is why they don't feel insecure. Even if someone says something that indicates that the don't like them, the confident people tend to bounce it off themselves and put it on the other person (what is Bob's problem today that he would say something like that?)
The people who are really insecure probably do the opposite - they assume everyone in the world dislikes them, even when the evidence says otherwise.
I understand what you are saying in a big way, Lilyflower. As I've been thinking about it though, I don't think that it's a matter so much of not being aware or magically ceasing to care when others think negatively of you. I don't even know if that is possible when you are a sensitive person who wants to relate well to other people.
Rather, I believe that your overall perspective changes as you mature. You develop a stronger intrinsic sense of self as far as your character and what you stand for, so it is easier to stand up for it. You have less to prove and are not as threatened, so you can be corrected more easily when you are wrong, without feeling it as a rejection of you as a person. You've seen more unreasonable people and so have a better sense of when someone's treatment of you has much more to do with their own issues than it does with you as a person. You have a bigger base of experience to draw from and so have more possible solutions available to you, you've developed healthy outlets for stress induced by situations or people, you have a stronger belief that there is a larger picture than what you see at the moment which puts your situation into perspective (or which can even ultimately work out for your benefit), and you more readily can avoid or recognize toxic situations/people because you see what certain surface behaviours actually indicate.
I certainly haven't arrived at that yet, but I am miles further than the first year I taught and was devastated by a mother coming in a telling me that her daughter hated my class and was going to quit playing the violin. In retrospect, I see that she was upset that her own (rather lazy) daughter was upset that she did not get all the solos for all of the year and she also was more interested in a boyfriend and social circle than in playing the violin. The mother was looking for someone to unload her own distress on and a first year teacher seemed like a likely choice.
After being pre-emptively rejected by two people whose greatest fear was rejection (and who assumed that I ultimately would reject them) I finally learned not to take it as a sign of me being deeply flawed or unloveable, but rather that you need two healthy people who are okay on their own to successfully maintain a healthy relationship. The flaw was not with me fundamentally, but rather was due to my insufficient base of experience and circumstances that allowed me to rely on someone who was not in an emotional state to be dependable. I was asking someone to do something that they simply did not have the resources for at the time.
Living in a small, very dysfunctional community (high alcoholism/drug addiction/domestic violence rates) finally allowed me to see that very little of people's reaction has much to do with yourself. As difficult as it was at the time, I finally accepted that rejecting behaviours more often stem from insecurity and fears rather than actual malice or ill-intent. That behaviour is as dangerous as if it were intentional, but I think that awareness better allows us to avoid getting closely involved with someone who cannot relate unselfishly or without taking care of their best interests first in an effort to survive. I suppose in some ways it's disappointing to realize just how unimportant and irrelevant we are to others in proportion to how self-conscious we are, but in another way it's extremely liberating. It shifts our thoughts from our own discomfort to actually seeing the clues around us that will help give context and understanding for why people act in rejecting or unkind ways. It even can give us a sense of kinship or sympathy for others that we couldn't possibly feel if we were missing those signals.
In any case, I think that confidence is often developed through experiences that give us assurance that we could navigate or recognize something similar if it came along. It is developed through building a support system of reliable people who do have emotional space left over to attend to your needs. It is developed through knowing what you can do well, so that you have the reassurance needed to admit what you still need help with and so that you can access that expertise.