[Bug debuginfod/31620] New: debuginfod should not require ssl support from libcurl

2024-04-08 Thread nolange79 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31620

Bug ID: 31620
   Summary: debuginfod should not require ssl support from libcurl
   Product: elfutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: debuginfod
  Assignee: unassigned at sourceware dot org
  Reporter: nolange79 at gmail dot com
CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

I would like to be able to copy over gdb to an embedded system and then do some
post-mortem debug.
To that end I use a libcurl with just HTTP support, no SSL of any kind.

Unfortunately debuginfod_client.c requests "http,https,file" at [1], and
libcurl then throws an error.

I would like debuginfod only request https if available.


[1]
https://sourceware.org/git?p=elfutils.git;a=blob;f=debuginfod/debuginfod-client.c;h=0ee7db3d66380899fc628efda7f339db7b8d6b9c;hb=HEAD#l1373

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug debuginfod/31620] debuginfod should not require ssl support from libcurl

2024-04-08 Thread fche at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31620

Frank Ch. Eigler  changed:

   What|Removed |Added

 CC||fche at redhat dot com

--- Comment #1 from Frank Ch. Eigler  ---
Okay, do you happen to know how debuginfod can find out whether libcurl
supports https?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug debuginfod/31620] debuginfod should not require ssl support from libcurl

2024-04-08 Thread nolange79 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31620

--- Comment #2 from nolange79 at gmail dot com ---
Should test for CURL_VERSION_SSL (since v7.10), from the docs [1]:

> curl_version_info can be used to get a list of all supported protocols in the 
> current libcurl.

[1] - https://curl.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug debuginfod/31620] debuginfod should not require ssl support from libcurl

2024-04-08 Thread fche at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31620

--- Comment #3 from Frank Ch. Eigler  ---
like this?  can you test?


diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index 0ee7db3d6638..a3468f534656 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -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)

-- 
You are receiving this mail because:
You are on the CC list for the bug.