10 Commits

Author SHA1 Message Date
Sebastian Wick
e4edecdef5 utils-http: Drop libsoup2 support in favor of libcurl
A few years ago there was a very painful attempt at porting from
libsoup2 to libsoup3. Flatpak libsoup3 support never landed and it seems
like a large amount of distros have switched over to libcurl instead.

This commit removes libsoup2 support completely instead of growing
libsoup3 support.

Closes #5915
Closes #4582
2025-11-20 17:40:57 +00:00
Owen W. Taylor
c75ba1c7e1 common: Implement /etc/containers/certs.d for OCI registries
Docker and podman can be configured to use mutual TLS authentication
to the registry by dropping files into system-wide and user
directories. Implement this in a largely compatible way.

(Because of the limitations of our underlying libraries, we
can't support multiple certificates within the same host config,
but I don't expect anybody actually needs that.)

The certs.d handling is extended so that certificates are separately
looked up when downloading the look-aside index. This is mostly
to simplify our tests, so we can use one web server for both -
in actual operation, we expect the indexes to be unauthenticated.

Also for testing purposes, FLATPAK_CONTAINER_CERTS_D is supported
to override the standard search path.

Co-authored-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-05-08 16:08:21 +00:00
Simon McVittie
4b159b11eb httpcache: Free the GError before exiting
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-15 20:33:06 +00:00
Simon McVittie
bf8e91cedc common: Stop including utils-http in utils
utils-http is conceptually larger than utils.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-07-03 20:07:57 +02:00
Alexander Larsson
b1083a4c41 http utils: Make a generic FlatpakHttpSession instead of SoupSession
Its still just a SoupSession, but now the implementation is more
centralized and can be something else down the line.
2022-06-16 13:49:45 +02:00
Matthew Leeds
fece775029 Fix a leak of SoupSession
Closes: #2740
Approved by: matthiasclasen
2019-03-06 23:44:50 +00:00
Matthew Leeds
8d962a686f Run uncrustify
I had to make a few manual edits but other than those the changes look
reasonable.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Alexander Larsson
3fa34ebd8a Work around libsoup recursive type hang in tests
Closes: #1952
Approved by: alexlarsson
2018-08-09 15:45:08 +00:00
Owen W. Taylor
c4c06b7be4 Allow using a compressed cache for HTTP downloads
Add a new flag for flatpak_cache_http_uri() that adds Accept-Encoding: gzip
to the request, and if the result is returned compressed, stores the data
compressed. If the data result is return uncompressed, it's compressed.

Closes: #1910
Approved by: alexlarsson
2018-08-09 12:49:35 +00:00
Owen W. Taylor
951aed561a Add flatpak_cache_http_uri: cache downloads based on HTTP headers
Add a new function, flatpak_cache_http_uri() that when passed an URL and
a local destination location, either a) downloads the content and stores
it at the destination location, storing HTTP cache header information
like Last-Modified, Etag into user xattrs (if available) or a separate
file or b) if the downloaded content is already present, checks the
header information to decide whether the downloaded content can be used
or needs to be revalidated witha conditional request.

Tests are added that use a special case test server that adds HTTP caching
headers and reacts to them based on query parameters. A small test binary
'httpcache' is added for the tests to use.

Closes: #1910
Approved by: alexlarsson
2018-08-09 12:49:35 +00:00