TAMRA BARNEY was the picture of happiness as she tied the knot for the third time, but the “Real Housewives of Orange County” star is still reeling from dark secrets that cloud her life.

The ENQUIRER learned that when the 45-year-old beauty was a teen mom battling depression, she gave up custody of her son Ryan Vieth for several years before getting him back.

AND when she was in her early 20s and divorced for the first time, she hit rock bottom – and tried to kill herself.

“I took a bunch of prescription medication that I found in my mom’s cupboard,” she revealed last October during a speech at a women’s conference.

“My mom found me…They admitted me into a mental hospital.”

Her son Ryan, now 27, has gone through his own turmoil and heartbreak.

When the youngster was just 9, Tamra gave her ex-husband Darren Vieth sole physical custody of him, according to Los Angeles Superior Court documents obtained exclusively by The ENQUIRER.

“She felt unequipped to take care of her boy,” revealed an insider.

Ryan went on a downward spiral. He’s battled depression and anxiety and has had several scrapes with the law, ending up in jail. On May 19, 2010, he was arrested by Orange County sheriff’s deputies for missing a court appearance for unpaid fines.

Mother-of-four Tamra – who recently walked down the aisle with third husband Eddie Judge – “has talked about issues with her own parents,” said the insider, “but she still hasn’t opened up about giving up custody of her son.”