unit tests for cert based auth