Note: This is edited to correct a blunder pointed out by YACP in comments below.
Let $J := p_1 \cap \cdots \cap p_n$; this is the Jacobson radical of $A$.
Note that the inclusion $J p_1 \subset p_1^2 \cap p_2 \cap \cdots \cap p_n$
is an equality (check after localizing at each $p_i$). Thus the Chinese Remainder Theorem shows that $p_1/J p_1 \cong p_1 /p_1^2 \times A/p_2 \times \ldots \times A/p_n,$ which is $\cong m_1/m_1^2 \times A/p_2 \times \ldots \times A/p_n$,
and hence is a cyclic module. (If $C_i$ is a collection of cyclic modules over the rings $A_i$, then $\prod C_i$ is cyclic over $\prod A_i$ (a cyclic generator
is given by taking a product of cyclic generators). By Nakayama, we see that $p_1$ itself is cyclic,
i.e. a principal ideal. The same argument applies to each $p_i$.
Some more details added at OP's request: $p_1$, $p_2$, etc. are distinct maximal
ideals, thus each pair $p_i, p_j$ ($i \neq j$) generates the unit ideal. Then $p_1^2, p_2,\ldots, p_n$ have the same property, and so CRT gives $A/Jp_1 = A/(p_1^2 \cap p_2 \cap \cdots \cap p_n) = A/p_1^2 \times A/p_2 \times \cdots A/p_n.$
Thus the image of $p$ in $A/ J p_1,$ which is equal to $p_1/J p_1$,
is equal to the ideal generated by $p_1$ in the product. In each $A/p_i$ ($i > 1$) we have $p_1$ generates the unit ideal, and so we see that $p_1 / J p_1$
equals $p_1/p_1^2 \times A/p_2\times \cdots \times A/p_n$, as claimed.
A variation of this is as follows: a Dedekind domain with only finitely many prime ideals is necessarily a PID, by the same Chinese Remainder Theorem argument. Note that this gives a proof of the infinitude of primes: if it were false,
then by general Dedekind domain theory, each ring of algebraic integers
would again only have finitely many prime ideals, and hence would be a PID. But e.g. $\mathbb Z[\sqrt{-5}]$ is easily checked to not be a PID, and so there must actually be infinitely many primes! (This proof is due to Larry Washington, see here.)