Move certificate request checking into utilities to remove duplication in client