libsdb/libsdb — pull request #3 by taviso (2014-10-01 19:31:06+00:00)
Title: Fix crash on Fedora, due to curl not initializing SSL.

libsdb crashes on any usage on Fedora as the SSL library is not initialized, I assume this is because curl uses openssl on other platforms and you manually initialize it with SSL_library_init() in sdb_create_curl(). But on Fedora curl uses NSS, so it never gets initialized.

You can only initialize libcurl once, due to a check in curl_global_init(), so when you call curl_global_init() in sdb_global_init with CURL_GLOBAL_NOTHING, subsequent calls trying to initialize more features (like ssl) via curl_easy_init() don't do anything.

I think the simplest solution is just to initialize everything in sdb_global_init(). This *might* mean you don't have to call SSL_library_init() (I haven't tested Ubuntu/Debian), because curl should take care of it for you. With this patch, the test binary appears to be working normally on Fedora.