The minimum number of distinct midpoints is 4031, which can be achieved when we place the 2017 points equidistant on a straight line. It is easy to verify that the midpoint between any two adjacent points on the line and all points except the two at the ends of the line are the only midpoints, which indeed totals up to 4031 midpoints.
To prove the lower bound, we consider the fact that the number of segments formed is finite, thus there exists a line on the plane such that no segment is perpendicular to this line. We construct the $x$-axis on this line, noting that each point has a different $x$-coordinate.
Let the 2017 $x$-coordinates be $x_1<x_2<...<x_{2017}$. It follows that $$\frac{x_1+x_2}{2}<\frac{x_1+x_3}{2}<...<\frac{x_1+x_{2017}}{2}<\frac{x_2+x_{2017}}{2}<...<\frac{x_{2016}+x_{2017}}{2}$$are 4031 distinct $x$-coordinates of midpoints of segments, thus there must indeed be at least 4031 distinct midpoints.