I'm trying to prove the following statement: All open sets in the spectrum $X=\operatorname{Spec}(A)$ of a Dedekind domain $A$ are affine. Since all open sets are cofinite, my idea is to prove that an open set of the form $X-\mathfrak{p}$ is affine, and then use induction.
I've found this question, which explains the condition for all open sets to be principal. In particular, if $\mathfrak{p}$ is of finite order in the ideal class group, then $\mathfrak{p}^n=(f)$, $X-\mathfrak{p}=D_f$ is principal; if however $\mathfrak{p}$ is of infinite order, then $X-\mathfrak{p}$ is not principal. In this latter case, what is the coordinate ring? And how to prove that it is affine?
Thanks.