Convert certificate tests to httpretty

Change-Id: Ic7eacb75f90b383ecacf01269033c0a37bd7528c
blueprint: httpretty-testing
Merge "Convert certificate tests to httpretty"