She’s free to tweet about her affair with a married millionaire businessman — but she still can’t go near him or his wife.

Delphi Financial Group CEO Robert Rosenkranz studiously avoided making eye contact with his onetime mistress Katherine Nelson in Manhattan Family Court on Wednesday as a judge lifted a restraining order on her use of social media.

Justice Stewart Weinstein tossed a temporary order barring Nelson, 40, from spouting off online about her years-long affair with Rosenkranz, 72.

But Weinstein kept another ruling that bars the buxom blonde from contacting or even going near the gray-haired Yale and Harvard grad and his wife.

In the Family Court waiting area, Rosenkranz changed seats when Nelson — whom he once called “the most beautiful woman in the room,” according to her court papers — arrived, so he wouldn’t have to look at her.

He only raised his eyebrows in the direction of his ex, who was dressed in a short black skirt and black boots, when she was discussing with The Post a planned tell-all book.

She said the ruling frees her to shop around the tome, called “River House: The Love Story,” about her trysts with Rosenkranz, who lives in the swank, East 52nd Street co-op River House that’s also home to Henry Kissinger and Uma Thurman. He lives there with his wife, Guggenheim curator Alexandra Munroe.

The head of the $10 billion insurance holding company got a temporary order of protection against Nelson last year after she contacted his wife through Twitter to gloat about their dalliances.

“You must have known,” Nelson tweeted at Munroe in August with a picture of stationery in her husband’s name and the note, “For me, two is a remarkable number.”

In a statement, Rosenkranz’s lawyer, Peter Bronstein, said, “Mr. Rosenkranz and his wife are deeply committed to one another and he is determined to protect both of them from a woman whose motivations are all about anger, money and publicity.’’

The statement adds that a “confidentiality agreement signed by Ms. Nelson” bars her from publishing anything about Rosenkranz, online or in print. He plans to enforce the deal, for which the CEO says he paid Nelson $100,000, in Manhattan Supreme Court, where the duo is waging another legal battle.