Laplace equation, medium discontinuity and finite difference method

The main question is: How to deal with the Poisson equation in the presence of the medium interface.

Let's say we have 1D Laplace equation: $$-\frac{d}{dx}\left(\epsilon(x)\frac{d}{dx}\right)\phi(x)=0$$ or $$-\left(\frac{d\epsilon}{dx}\frac{d}{dx}+\epsilon\frac{d^2}{dx^2} \right)\phi(x)=0.$$ Now, consider the case when $$\epsilon(x) = \begin{cases} \epsilon_1 & \mbox{if } x<0 \\ \epsilon_2, & \mbox{if } x>0 \end{cases}$$.

If I put the equation on the equally spaced grid $$x=n\cdot a, \ \ n=...-2,-1,0,1,2...$$ ($a$ is the discretization constant) and replace the continues derivatives with the discrete counterparts, there is a problem at $x=0$ with the $$\frac{d\epsilon}{dx}\approx \frac{\epsilon(x+a)-\epsilon(x-a)}{2a},$$ because it's clearly depend on the grid spacing. Even in the limit $a\rightarrow0$ there seems to be a problem. What is the typical method to deal with such a problem?