curl: Try to initialize with SSL support to handle https:// URIs
authorMartin Willi <martin@revosec.ch>
Thu, 28 Aug 2014 09:09:26 +0000 (11:09 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 24 Sep 2014 09:35:59 +0000 (11:35 +0200)
If initialization fails, we fall back to the old behavior.

src/libstrongswan/plugins/curl/curl_plugin.c

index 062fe12..ab63a50 100644 (file)
@@ -79,7 +79,12 @@ plugin_t *curl_plugin_create()
                },
        );
 
-       res = curl_global_init(CURL_GLOBAL_NOTHING);
+       res = curl_global_init(CURL_GLOBAL_SSL);
+       if (res != CURLE_OK)
+       {
+               /* no SSL support? Try without */
+               res = curl_global_init(CURL_GLOBAL_NOTHING);
+       }
        if (res != CURLE_OK)
        {
                DBG1(DBG_LIB, "global libcurl initializing failed: %s",