The large majority of sources detected by the Fermi Gamma-ray Space Telescope are blazars, belonging in particular to the blazar subclass of BL Lacertae objects (BL Lacs). BL Lacs often have featureless optical spectra, which make it difficult and sometimes impossible to determine their redshifts. This presents a severe impediment for the use of BL Lacs to measure the spectrum of the extragalactic background light through its interaction with high-energy γ-ray photons. I present here high-quality optical spectroscopy of two of the brightest γ-ray blazars, namely PKS 0447−439 and PMN J0630−24. The medium-resolution and high signal-to-noise ratio optical spectra show clear absorption lines, which place these BL Lacs at relatively high redshifts of z≥ 1.246 for PKS 0447−439 and z≥ 1.238 for PMN J0630−24.