The stench of past scandals is haunting Hillary Clinton as allegations regarding the family’s foundation fester.

News that the Clinton Global Initiative aided a company part-owned by a close female friend of Bill Clinton highlights two issues that the Democratic front-runner wants to put behind her as she prepares for the general election — her husband’s infidelity and the charity’s shady ethics.

The Clinton nonprofit helped secure a pledge in 2010 for a $2 million investment in Energy Pioneer Solutions. The for-profit green-energy company is co-owned by several well-connected Democrats, as well as wealthy divorcée Julie Tauber McMahon, a neighbor of the Clintons’ in Chappaqua.

Bill Clinton reportedly made a call to then-Energy Secretary Steven Chu to endorse the company, which helps people insulate their houses. It later got an $812,000 Energy Department grant.

Federal law bars tax-exempt charitable organizations from acting to benefit a private company. But the foundation said the relationship with the firm reflected “a common practice in the broader philanthropic space.”

The investment deal, which was trimmed to $500,000, was announced at the Clinton Global Initiative’s 2010 conference, The Wall Street Journal reported, but details about it were wiped from the charity’s Web site to avoid calling attention to McMahon.

‘The Clinton foundation controversies give good material to Trump as the two campaigns engage in a scorched-earth game called “Who’s More Corrupt?”‘ - Larry Sabato, director of the University of Virginia’s Center for Politics

The 69-year-old former president describes McMahon, 56, as a “family friend.” But speculation is rife that she’s the woman dubbed “Energizer” by Secret Service agents because of her frequent visits to the Clintons’ Westchester home when Bill was home but Hillary wasn’t.

McMahon, daughter of a millionaire donor to the Democratic Party, has denied having an affair with Bill Clinton, 69. She could not be reached for comment.

The revelations bring new attention to the ethical minefield the Clinton foundation navigated with governments and corporations while Hillary Clinton was secretary of state.

They are also hampering her attempts to win over Bernie Sanders supporters who question her trustworthiness. Currently, a quarter of Sanders supporters say they wouldn’t vote for Hillary in the general election, according to GOP pollster Frank Luntz.

And the issue feeds the “Crooked Hillary” message Donald Trump is pushing, even as she attempts to shift the focus to the Republican front-runner’s reluctance to release his tax returns.

“The Clinton foundation controversies give good material to Trump as the two campaigns engage in a scorched-earth game called ‘Who’s More Corrupt?’ ” said Larry Sabato, director of the University of Virginia’s Center for Politics. “As always, the best defense is a good offense.”

The Clintons’ questionable ethics were already a negative with voters, said political consultant Susan Del Percio.

“This just calls into even more question their honesty and integrity,” she added.

The latest headlines also play into the investigation of Hillary Clinton’s use of a private e-mail server when she headed the State Department, Del Percio said.

Any new charges would mean “she can’t put the old allegations behind her. They make what was old new again,” she said.

As for the airing of more of the Clintons’ marital dirty laundry, Del Percio said, “it plays into a longstanding narrative” that casts Bill Clinton as a serial philanderer.

It’s a narrative that Trump is already exploiting.

“Trump appears to be inclined to make that an issue,” said political consultant Gerry O’Brien. “Especially if [Hillary Clinton] makes an issue of his indiscretions, like his comments and conduct with beauty . . . contestants.”

But, O’Brien warns, that tactic may boomerang for Trump.

“Hillary has always thrived when she can play the victim,” he said.