Fix cert reading