A set of electrical connectors includes a connector and a mating connector. The connector comprises a locking device mounted on a housing so as to slide in a locking direction between a pre-locking position and a locking position. The connector also has a latch. The latch is provided with a locking surface for locking the connector to the mating connector. The latch extends between a junction that joins it to the body of the housing and at least the locking surface in a direction opposite to the locking direction.