Fix tests that use a self-signed certificate, use proper new AHC APIs