<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libfetch, branch release/14.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-02-26T18:00:38Z</updated>
<entry>
<title>libfetch: Fail hard if interrupted while connecting</title>
<updated>2026-02-26T18:00:38Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-21T01:18:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ca76ec7c4e563292a0c75781683b0421a4439a02'/>
<id>urn:sha1:ca76ec7c4e563292a0c75781683b0421a4439a02</id>
<content type='text'>
This fixes an issue where the first address that DNS returns is blocked
by a packet filter, so we hang for a while, then the user hits Ctrl-C,
interrupting connect(2), whereupon we move on to the next address, get
a connection, request the file, and return to fetch(1), which sees that
SIGINT was caught and bails.

Note that we make no attempt to enforce fetchTimeout in the connection
phase, and never have.  It's feasible, but non-trivial, so we'll leave
it as an exercise for future us.

PR:		293312
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55406

(cherry picked from commit afbdcd402bb439bd3d487baaad63b68e95929265)
(cherry picked from commit cca6f5eadb796b03379eb21f38c74ca46a64e45b)
</content>
</entry>
<entry>
<title>libfetch: Restore timeout functionality</title>
<updated>2026-02-19T19:21:21Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-18T15:10:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8755b5f3a590560996fb122abe22644d3be3836a'/>
<id>urn:sha1:8755b5f3a590560996fb122abe22644d3be3836a</id>
<content type='text'>
PR:		293124
MFC after:	1 week
Fixes:		792ef1ae7b94 ("Refactor fetch_connect() and fetch_bind() to improve readability and avoid repeating the same DNS lookups.")
Reverts:	8f8a7f6fffd7 ("libfetch: apply timeout to SSL_read()")
Reviewed by:	eugen, imp
Differential Revision:	https://reviews.freebsd.org/D55293

(cherry picked from commit 73b82d1b0a2f09224e6d0f7a13dd73c66d740207)
(insta-mfc requested by re@)
(cherry picked from commit d97c824f5b4c9e7e3a1400699022cba146e450fa)
</content>
</entry>
<entry>
<title>libfetch: Check for failure to create SSL context</title>
<updated>2026-02-12T21:24:34Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-07T14:24:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=53e0a1d1ff9b9a8bd27fa65e0f84ca95f0e41298'/>
<id>urn:sha1:53e0a1d1ff9b9a8bd27fa65e0f84ca95f0e41298</id>
<content type='text'>
* Drop the ssl_meth member, there is no reason to hang on to it.

* Replace deprecated SSLv23_client_method() with TLS_client_method().

* Check the return value from SSL_CTX_new().

Approved by:	re (cperciva)
MFC after:	1 week
PR:		292903
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D55098

(cherry picked from commit 4e160c6197f75fda3d5d5997ce893087058cf718)
(cherry picked from commit 4781aeb5b9cb564a53fee8128f6827402deaf9df)
</content>
</entry>
<entry>
<title>MFC: libfetch: allow disabling TLS v1.3 when negotiating the connection</title>
<updated>2026-01-25T04:16:30Z</updated>
<author>
<name>Eugene Grosbein</name>
<email>eugen@FreeBSD.org</email>
</author>
<published>2026-01-22T14:37:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c41b12651a80e5c3c227e7428c2804f66ec17f2c'/>
<id>urn:sha1:c41b12651a80e5c3c227e7428c2804f66ec17f2c</id>
<content type='text'>
(cherry picked from commit 129aec72250266e60c07ff4643623188f7c27a9d)
</content>
</entry>
<entry>
<title>MFC: libfetch: apply timeout to SSL_read()</title>
<updated>2026-01-25T04:13:02Z</updated>
<author>
<name>Eugene Grosbein</name>
<email>eugen@FreeBSD.org</email>
</author>
<published>2026-01-22T08:40:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fae1c84e95f7be4deacdab8a97f140714d8d2ae8'/>
<id>urn:sha1:fae1c84e95f7be4deacdab8a97f140714d8d2ae8</id>
<content type='text'>
Currently, fetchTimeout works for non-SSL connections only, so does fetch -T.
Fix it applying specified timeout to SSL_read().

(cherry picked from commit 8f8a7f6fffd7dca09013f7c4bfa075bc3825fb8e)
</content>
</entry>
<entry>
<title>lib: Fix calls that naively set F_SETFD.</title>
<updated>2025-08-25T13:57:56Z</updated>
<author>
<name>Ricardo Branco</name>
<email>rbranco@suse.de</email>
</author>
<published>2025-07-14T20:10:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a58eb4d233bfdddff243faec071f8dc18d3e5492'/>
<id>urn:sha1:a58eb4d233bfdddff243faec071f8dc18d3e5492</id>
<content type='text'>
With the recent inclusion of the FD_CLOFORK and FD_RESOLVE_BENEATH flags,
we must avoid clearing them when setting only FD_CLOEXEC.

Signed-off-by: Ricardo Branco &lt;rbranco@suse.de&gt;

Reviewed by:	kib, markj
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1766

(cherry picked from commit 8768b60de16a3d72a8783ec1241a711a782a36a9)
</content>
</entry>
<entry>
<title>libfetch: don't include fragments in HTTP requests</title>
<updated>2024-09-05T14:05:15Z</updated>
<author>
<name>Pietro Cerutti</name>
<email>gahr@FreeBSD.org</email>
</author>
<published>2024-08-21T12:35:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ab7a79806e3103accb1ba2d89ba51e977704a2e3'/>
<id>urn:sha1:ab7a79806e3103accb1ba2d89ba51e977704a2e3</id>
<content type='text'>
Fragments are reserved for client-side processing, see
https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1

Also, some servers don't like to receive HTTP requests with fragments.

```
$ fetch 'https://dropbox.com/a/b'
fetch: https://dropbox.com/a/b: Not Found

$ fetch 'https://dropbox.com/a/b#'
fetch: https://dropbox.com/a/b#: Bad Request
```

This is a real-world scenario, where some download link from dropbox
(eventually) redirects to an URL with a fragment:

```
$ fetch -v 'https://www.dropbox.com/sh/&lt;some&gt;/&lt;thing&gt;?dl=1' 2&gt;&amp;1 | grep requesting
requesting https://www.dropbox.com/sh/&lt;some&gt;/&lt;thing&gt;?dl=1
requesting https://www.dropbox.com/scl/fo/&lt;foo&gt;/&lt;bar&gt;?rlkey=&lt;baz&gt;&amp;dl=1
requesting https://&lt;boo&gt;.dl.dropboxusercontent.com/zip_download_get/&lt;some-long-strig&gt;#
```

See how the last redirect ends with a `#`.

Currently, libfetch includes the ending fragment and makes it impossible
to download the file.

Differential Revision:	https://reviews.freebsd.org/D46318
MFC after:		2 weeks

(cherry picked from commit 1af7d5f389536a2f391153513d95d92ffdf360e4)
</content>
</entry>
<entry>
<title>libfetch: parse scheme://domain:/ correctly</title>
<updated>2024-04-03T19:11:58Z</updated>
<author>
<name>Ka Ho Ng</name>
<email>khng@FreeBSD.org</email>
</author>
<published>2024-03-25T20:10:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=72c3d91294c4d9c46c8185f90cba522f539d1051'/>
<id>urn:sha1:72c3d91294c4d9c46c8185f90cba522f539d1051</id>
<content type='text'>
This improves URL-parsing compability with cURL, and unbreaks parsing of
similar kinds of URLs after commit 8d9de5b10a24.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	des
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44493

(cherry picked from commit fb860ed0c52c2c1e7792ef86718620a439663c7f)
</content>
</entry>
<entry>
<title>libfetch, fetch: Stop recommending the use of ca_root_nss.</title>
<updated>2023-12-13T16:23:57Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2023-10-08T04:35:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6d0ea82cc2520726e49d9f03e1b67734608139e7'/>
<id>urn:sha1:6d0ea82cc2520726e49d9f03e1b67734608139e7</id>
<content type='text'>
MFC after:	3 days
Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D42119

(cherry picked from commit 2821a7498f65d357c68166e1978b491abef1ca4a)
</content>
</entry>
<entry>
<title>libfetch: don't rely on ca_root_nss for certificate validation</title>
<updated>2023-10-05T00:03:16Z</updated>
<author>
<name>Michael Osipov</name>
<email>michael.osipov@siemens.com</email>
</author>
<published>2023-10-03T05:53:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fb058a9a40a5adc82721ed822fb4fba213446a7b'/>
<id>urn:sha1:fb058a9a40a5adc82721ed822fb4fba213446a7b</id>
<content type='text'>
Before certctl(8), there was no system trust store, and libfetch
relied on the CA certificate bundle from the ca_root_nss port to
verify peers.

We now have a system trust store and a reliable mechanism for
manipulating it (to explicitly add, remove, or revoke certificates),
but if ca_root_nss is installed, libfetch will still prefer that to
the system trust store.

With this change, unless explicitly overridden, libfetch will rely on
OpenSSL to pick up the default system trust store.

PR:		256902
MFC after:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D42059

(cherry picked from commit 09f5c1e118bb4eca77b83a0d08f559b20f60aa59)
</content>
</entry>
</feed>
