]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6983 wrap new curl TLS macro usage with ifdefs
authorNathan Neulinger <nneul@neulinger.org>
Tue, 11 Nov 2014 22:26:44 +0000 (16:26 -0600)
committerNathan Neulinger <nneul@neulinger.org>
Tue, 11 Nov 2014 22:26:44 +0000 (16:26 -0600)
src/mod/applications/mod_httapi/mod_httapi.c

index 4dade0f959a09e50ced49ed639b1fcaf2062ecd7..420b7578d912de9b6d6beb1a0a06fcd774eb7294 100644 (file)
@@ -1625,10 +1625,14 @@ static switch_status_t httapi_sync(client_t *client)
        if (client->profile->ssl_version) {
                if (!strcasecmp(client->profile->ssl_version, "SSLv3")) {
                        switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3);
+#ifdef CURL_SSLVERSION_TLSv1_1
                } else if (!strcasecmp(client->profile->ssl_version, "TLSv1.1")) {
                        switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_1);
+#endif
+#ifdef CURL_SSLVERSION_TLSv1_2
                } else if (!strcasecmp(client->profile->ssl_version, "TLSv1.2")) {
                        switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
+#endif
                }
        } else {
                switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
@@ -2533,10 +2537,14 @@ static switch_status_t fetch_cache_data(http_file_context_t *context, const char
        if (client->profile->ssl_version) {
                if (!strcasecmp(client->profile->ssl_version, "SSLv3")) {
                        switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3);
+#ifdef CURL_SSLVERSION_TLSv1_1
                } else if (!strcasecmp(client->profile->ssl_version, "TLSv1.1")) {
                        switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_1);
+#endif
+#ifdef CURL_SSLVERSION_TLSv1_2
                } else if (!strcasecmp(client->profile->ssl_version, "TLSv1.2")) {
                        switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
+#endif
                }
        } else {
                switch_curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);