Exercise 8 of chapter IX.3 of Cohn's book Advanced Number Theory reads:
Show that if the fundamental discriminant $d = g_1 g_2 < 0$ satisfies $(g_1/p) = (g_2/p) = -1$ for a prime $p$, then the divisors of the ideal $(p)$ in the number ring of $\mathbb{Q}(\sqrt{d})$ are nonprincipal.
This is equivalent to showing that the diophantine equation $$4p = x^2 + |g_1g_2| y^2$$ if $d \equiv 1$ mod $4$, or $$p = x^2 + |g_1g_2| y^2$$ otherwise, has no integer solution $(x, y)$.
If $p$ is odd and $d \equiv 1$ mod $4$, quadratic reciprocity leads to $p$, $g_1$ and $g_2$ being $\equiv 3$ mod $4$, but I am not sure how to obtain more information from the sign of the Legendre symbols. Any help would be appreciated.
Here's an example that makes clear what's going on. Let $d = -3 \cdot 5$; then $(-3/17) = (5/17) = -1$. This implies that $p$ splits in $k$; reducing the equation $4 \cdot 17 = x^2 + 15y^2$ modulo $5$ implies $(17/5) = +1$: contradiction by the quadratic reciprocity law.