+1  A: 

After further investigation, I found that this error was due to a failure to initialise the openSSL library by calling SSL_library_init().

Jon Trauntvein