The photoluminescence (PL) quantum yield of semiconductor nanocrystals (NCs) is hampered by in-gap trap states due to dangling orbitals on the surface of the nanocrystals. While crucial for the rational design of nanocrystals, the understanding of the exact origin of trap states remains limited. Here, we treat CdTe nanocrystal films with different metal chloride salts and we study the effect on their optical properties with in situ spectroelectrochemistry, recording both changes in absorption and photoluminescence. For untreated CdTe NC films we observe a strong increase in the PL intensity as the Fermi-level is raised electrochemically and trap states in the bandgap become occupied with electrons. Upon passivation of these in-gap states we observe an increase in the steady state PL and, for the best treatments, we observe that the PL no longer depends on the position of the Fermi level in the band gap, demonstrating the effective removal of trap states. The most effective treatment is obtained for Z-type passivation with CdCl2, for which the steady state PL increased by a factor 40 and the PL intensity became nearly unaffected by the applied potential. X-ray Photoelectron Spectroscopy measurements show that treatment with ZnCl2 mainly leads to X-type passivation with chloride ions, which increased the PL intensity by a factor four and made the PL less susceptible to modulation by applying a potential with respect to unpassivated nanocrystal films. We elucidate the spectroelectrochemical signatures of trap states within the bandgap and conclude that undercoordinated Te at the surface constitutes the largest contribution to in-gap trap states, but that other surface states that likely originate on Cd atoms should also be considered.