Aims. The predictions of the ellipticity of the dark matter halos from models of structure formation are notoriously difficult to test with observations. A direct measurement would give important constraints on the formation of galaxies, and its effect on the dark matter distribution in their halos. Here we show that galaxy-galaxy flexion provides a direct and potentially powerful method for determining the ellipticity of (an ensemble of) elliptical lenses. Methods. We decompose the spin-1 flexion into a radial and a tangential component. Using the ratio of tangential-to- radial flexion, which is independent of the radial mass profile, the mass ellipticity can be estimated. Results. An estimator for the ellipticity of the mass distribution is derived and tested with simulations. We show that the estimator is slightly biased. We quantify this bias, and provide a method to reduce it. Furthermore, a parametric fitting of the flexion ratio and orientation provides another estimate for the dark halo ellipticity, which is more accurate for individual lenses Overall, galaxy-galaxy flexion appears as a powerful tool for constraining the ellipticity of mass distributions.