ensure that a valid certificate exists during prepare