Ran into some trouble with Ubuntu 12.0.4 and an “SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure” error while accessing the Zoho Docs API through Python. Apparently Zoho’s API endpoint enforces a certain SSL version. The full python error was:
SSLError: [Errno 1] _ssl.c:504: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
After ruling out python and openssl, the fix was to simply update to Ubuntu 188.8.131.52 through apt:
And for the hell of it did a distribution upgrade:
After dealing with Exact Target‘s XML api for their email list management system, I decided to package up a few functions into a class. Check out python-exacttarget on my GitHub page.
I came across a problem today with phpFlickr 3.1 and the way it handles its database caching. I believe it has to do with commas in the serialized data that is being inserted into the cache table. After grabbing the cache result php gave me this error in the phpFlickr library:
Notice: unserialize(): Error at offset ... phpFlickr.php
To fix this error you need to base64 encode and decode the data going into the database.
in phpFlickr modify line 144 to decode the response:
line 177 on cache row update:
$sql = "UPDATE " . $this->cache_table . " SET response = '" . str_replace("'", "''", base64_encode($response)) . "', expiration = '" . strftime("%Y-%m-%d %H:%M:%S") . "' WHERE request = '" . $reqhash . "'";
line 180 on cache row insert:
$sql = "INSERT INTO " . $this->cache_table . " (request, response, expiration) VALUES ('$reqhash', '" . str_replace("'", "''", base64_encode($response)) . "', '" . strftime("%Y-%m-%d %H:%M:%S") . "')";
Thanks to David Walsh for his php serialize tips: