I'm sorry your day had to start this way, but you need to realize now that this path back to emotional health and strength for your family is NOT going to be a straight-line path. The truth is you're not as strong as you thought you were yesterday, nor are you as weak and horrible as you feel you are this morning.
And actually, I think you handled the conversation quite well, really.
You did well in enforcing your boundaries, speaking plain truth in love, and in protecting your son. I think where you veered off track was in letting your H put you on the defensive about your friend. A simple "I can't help what other people decide to say to you; I've decided that I'm no longer willing to cover up your affair," and left it at that. Or "I certainly didn't tell or ASK her to contact you, but I'm also not going to protect you from the consequences of your affair -- this is YOUR mess; I"m not going to clean it up for you." Or something similar.
I'm not sure what you mean by "fit", but if he was ranting disrespectfully, shouting, etc., or using language that you're not comfortable with, just end the conversation calmly by saying "I'm not going to talk to you when you're like this. I don't deserve to be disrespected this way," and walk away. It takes two to have a conversation.
I do think you should plan ways, logistically, to avoid as many of these situations with him as possible. But if confronted again, just do as I suggest above.
YOU DID FINE. You're trying to judge how "correctly" you handled a difficult situation, by how ANGRY he got, or how upset you feel right now -- and neither are good yardsticks. The only yardsticks you need to be concerned with right now are "Did I do THE RIGHT THING" (and you did), and "LONG-TERM, does this get me closer to my goal?" (and I think it does).