only use cert when file exists