The PHP API for Cloud Files does not catch CURL errors. An exception will be thrown, however it will not contain any useful information to troubleshoot the problem. Here is a likely symptom and a solution.
You may notice messages in the stack trace about being unable to authenticate, but no reason as to why. For example, using the WordPress CDN Tools plugin, the error message might look like the following:
Fatal error: Uncaught exception 'InvalidResponseException' with message 'Unexpected response (): ' in
The problem that I ran into was missing CA certificates. It was resolved by running the following command on my Ubuntu box:
sudo aptitude install ca-certificates
An alternative is to ignore certificates altogether, which from a security standpoint is not very wise. But if you are desperate, add the following to cloudfiles_http.php line 210 (as of the time of this writing, the current version is 1.3.0). There should be a block of curl_setopt() commands. Add the command before the curl_exec().
curl_setopt($curl_ch, CURLOPT_SSL_VERIFYPEER, false);
If that fails and the exception messages are not telling you what the problem is, it could be something different altogether. In this worst case scenario, place the following line just after the curl_exec() but before curl_close().
That should then give you the necessary information to correct the problem.
Good luck and feel free to post a comment if you discover different problems or solutions to the PHP API for Cloud Files.