[Bug,debuginfod/31620] debuginfod should not require ssl support from libcurl
Commit Message
https://sourceware.org/bugzilla/show_bug.cgi?id=31620
--- Comment #3 from Frank Ch. Eigler <fche at redhat dot com> ---
like this? can you test?
@@ -1367,14 +1367,19 @@ debuginfod_query_server (debuginfod_client *c,
} \
} while (0)
+ curl_version_info_data *d = curl_version_info(CURLVERSION_NOW);
+
/* Only allow http:// + https:// + file:// so we aren't being
redirected to some unsupported protocol. */
#if CURL_AT_LEAST_VERSION(7, 85, 0)
curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS_STR,
- "http,https,file");
+ ((d && d->ssl_version) ?
+ "http,https,file" : "http,file"));
#else
curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS,
- (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FILE));
+ (CURLPROTO_HTTP |
+ ((d && d->ssl_version) ? CURLPROTO_HTTPS : 0) |
+ CURLPROTO_FILE));
#endif
curl_easy_setopt_ck(data[i].handle, CURLOPT_URL, data[i].url);
if (vfd >= 0)