On the two-point boundary-value problem for equations of geodesics