If you generate the two-sided confidence interval with a confidence level of $95\%$ (or $\alpha = 5\%$), the cut-off points (or endpoints) of the interval will leave out a probability $\frac{1}{2} \alpha=2.5\%$ on either end.

If you are performing a one-sided test, and want to preserve a risk $\alpha = 5\%$ of rejecting the null when it is in fact true, you will want to generate a two-sided CI with and confidence level of $90\%$ to leave $5\%$ probability at each end.

So you double the initial $\alpha =5\%$ to $\alpha=10\%.$