Problems with Facebook API and M2Crypto

Reading time ~1 minute

After doing some crypto updates to a django application that I am working on, I discovered that the Facebook API was dog slow for retrieving any query using HTTPS. Turns out that the M2Crypto library apparently hijacks the SSL processing of urllib and mucks everything up. Thanks to this handy blog post, I was able to fix my Python implementation of the Facebook API and get things speeding along again.

The fix is basically to add the following lines before any urllib.urlopen() call (in my case, I only have two - one for GET and one for POST):

urllib._urlopener = urllib.FancyURLopener()
urllib._urlopener.addheader('Connection', 'close')

The Fastest Way to Success

What's the fastest way to success? We're all looking for shortcuts. Continue reading

Tips for New (or Not So New) Managers

Published on February 28, 2016

Making Sensu work with Graphite

Published on August 02, 2012