The Higgs boson mass and couplings to the electroweak gauge bosons were measured early after its discovery during LHC Run I. Sensitivity to the Higgs couplings to fermions however has required the large amount of data collected at a center-of-mass energy of 13 TeV during LHC Run II. Recent measurements of the Higgs boson couplings to tau leptons as well as top and bottom quarks mark crucial steps in understanding the mechanism of fermion-mass generation. In this presentation, the latest measurements of the associated production of a Higgs boson and a top quark-antiquark pair (ttH production) performed with the CMS experiment will be reviewed. The ttH production channel provides a direct probe of the coupling of the Higgs boson to the top quark and is instrumental in testing the Standard Model and constraining various potential new physics models.