log certficate validation error message

including refactoring of validator callback