Move certificate wrapping code and post letter URL routines into clientCommon