Sounds like you two (three?) talking is EXACTLY what you need right now.
As long as they have forgiven you, and you know what you've done wrong, stop beating yourself up (I know, I know, easier said than done). But really, learn from this, be a better person for it. I know how curiosity can get the better of you, especially when a third person is involved. Open information is critical to relationships, and if he was hiding something from you, in a small way it is good if you discovered it, but the method used was the wrong one. If you suspected him, you should've discussed it with him to allow him to confess.
Hopefully your relationship(s) can mend and find their way to happier days.