separate libcurl and http code error in case libcurl fails first
Support for setting cainfo (ie a particular ca to trust)
Some cleanup