Ramin Bastani was about to seal the deal with a girl a few years ago, but couldn’t figure out a non-awkward way to ask the big question. She noticed his hesitation and asked what was wrong: “Do you have an STD or something?” He responded, nervously, “No, I’m afraid you might.”

For his indelicate question, he got the clap . . . er, slap . . . across the face.

As she walked out, he thought to himself, “There has got to be a better way.”

Decades after awareness about safe sex has inserted itself into popular consciousness, we still have a problem asking a question (“Have you been tested?”) that should be as casual an inquiry as “Are you single?”

An estimated 19 million people catch a sexually transmitted infection of some kind every year in the United States, according to the Centers for Disease Control. But at last, technology is trying to ease the pain of bringing up that, ahem, burning question.

Bastani, a 37-year-old app developer, used his own awkward experience to create Qpid.me, a website and smartphone app that gathers the most recent STD results from your doctor, then allows you to share that information with your potential partner through a secure link — kind of like a private message, about your, um, privates.

“It’s a post-Viagra and post-‘Sex and the City’ world that we live in . . . and [yet] somehow [the issue of STDs] continues to be an uncomfortable conversation,” says Megan Fleming, a psychologist and sex therapist in the West Village. “The app is going to make it an easier conversation.”

Kris, a 22-year-old from LA, has been using the Qpid.me app for months and says it’s already eased awkwardness in sexual situations. He says that the best part of using it is that it seems legit; some guys he’s gone home with have recognized the app right away, and pulled out their phones to show off their own STD report.

“It’s made a lot of situations easier,” he says, “[and eliminated the need to] interrogate a person about their situation.”

But is an app the solution for all new relationships?

“If this is going to be some sort of fling or one-off hookup, then maybe [the app] will work just fine,” says Sari Cooper, an Upper West Side sex therapist. “Whereas if you wanted something long-term with somebody, I would think [a] conversation in person would be the place to go.” Old-fashioned conversation certainly makes the whole thing feel like less of a business transaction.

So the question still remains: What’s the etiquette for jumping into a conversation about your sexual cleanliness, app or no app?

Alonzo Davis, founder and director of JustBeenTested.com, a social media website that launched last month and allows users to share their test results and get information on STDs, says to make the conversation about both of you.

“You can say: ‘I’m thinking about getting tested. Do you want to come with me?’ ” he says. “If you put yourself in a position where you can be as vulnerable as the person you’re talking to, that makes it easier to have the [chat].”

Or you can be slightly more cunning in your approach: “Make it a question,” he says. “Say ‘I’m looking for a place to get tested. Do you know [anywhere]?’ It opens it up [to] more of a discussion.”

Plus, having “the talk” shows you are a responsible adult.

“Hopefully you’re showing the person that you care about them enough to be able to protect them as well,” Cooper says. And that isn’t a bad way to start any kind of relationship.