History log of /freebsd-current/lib/libfetch/fetch.3
Revision Date Author Comments
# 2821a749 07-Oct-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

libfetch, fetch: Stop recommending the use of ca_root_nss.

MFC after: 3 days
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D42119


# fa9896e0 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line nroff pattern

Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/


# ed5e7fb1 17-Sep-2022 Jens Schweikhardt <schweikh@FreeBSD.org>

There's no PEM(3) anywhere around; delete reference.


# fe85238e 24-Nov-2020 Jung-uk Kim <jkim@FreeBSD.org>

Remove support for SSLv3 from fetch(3).

Support for SSLv3 was already removed from OpenSSL (r361392).

Differential Revision: https://reviews.freebsd.org/D24947


# c44be5aa 15-Feb-2020 Kyle Evans <kevans@FreeBSD.org>

fetch(3): Add SOCKS5 support

This change adds SOCKS5 support to the library fetch(3) and updates the man
page.

Details: Within the fetch_connect() function, fetch(3) checks if the
SOCKS5_PROXY environment variable is set. If so, it connects to this host
rather than the end-host. It then initializes the SOCKS5 connection in
accordance with RFC 1928 and returns the resulting conn_t (file descriptor)
for usage by the regular FTP/HTTP handlers.

Design Decision: This change defaults all DNS resolutions through the proxy
by sending all IPs as hostnames. Going forward, another feature might be to
create another environmental variable to toggle resolutions through the
proxy or not..

One may set the SOCKS5_PROXY environment variable in any of the formats:

SOCKS5_PROXY=proxy.example.com
SOCKS5_PROXY=proxy.example.com:1080
SOCKS5_PROXY=192.0.2.0
SOCKS5_PROXY=198.51.100.0:1080
SOCKS5_PROXY=[2001:db8::1]
SOCKS5_PROXY=[2001:db8::2]:1080

Then perform a request with fetch(1).

(note by kevans)
I've since been informed that Void Linux/xbps has a fork of libfetch that
also implements SOCKS5. I may compare/contrast the two in the mid-to-near
future.

Submitted by: Farhan Khan <farhan farhan codes>
Differential Revision: https://reviews.freebsd.org/D18908


# f4e05cc5 28-Aug-2019 Mark Johnston <markj@FreeBSD.org>

Document fetchReqHTTP().

Submitted by: Farhan Khan <khanzf@gmail.com>
Reviewed by: 0mp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18788


# 225636dc 28-Mar-2016 Edward Tomasz Napierala <trasz@FreeBSD.org>

Fix bunch of .Xrs.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation


# 1ec923fd 19-Mar-2016 Michael Gmelin <grembo@FreeBSD.org>

Update fetch.1 and fetch.3 to reflect libfetch's actual use of CA bundles

Reviewed by: wblock
Approved by: wblock
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5558


# 4d8b056e 29-Nov-2015 Dag-Erling Smørgrav <des@FreeBSD.org>

Use .netrc for HTTP sites and proxies, not just FTP.

PR: 193740
Submitted by: TEUBEL György <tgyurci@gmail.com>
MFC after: 1 week


# 01ed3ca3 25-Mar-2015 Jung-uk Kim <jkim@FreeBSD.org>

Remove defunct SSLv2 support from fetch(1) and fetch(3).


# 76720765 15-Oct-2014 Dag-Erling Smørgrav <des@FreeBSD.org>

As pointed out by several people, r273114 was incorrect: it unconditionally
disabled everything except TLS 1.0. Replace it with a more carefully
wrought patch:

- Switch the default for SSLv3 from on to off
- Add environment variables to control TLS 1.1 and 1.2
- In verbose mode, report which version is used
- Update the man page to reflect these changes.

MFC after: 1 week


# 6cfac37b 11-Jun-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Use Mt macro to properly format mailto links (patch from Franco Fichtner <franco@lastsummer.de> for Dragonfly)

Reviewed by: des
Approved by: des
Obtained from: Dragonfly
MFC after: 1 week


# c257f99e 05-Jun-2014 Dag-Erling Smørgrav <des@FreeBSD.org>

If HTTP_USER_AGENT is defined but empty, don't send User-Agent at all.

PR: 184507
Submitted by: jbeich@tormail.org (with modifications)
MFC after: 1 week


# 1453595f 30-Jul-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Include an Accept header in requests.

PR: kern/180917
MFC after: 1 week


# dcd47379 26-Jul-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Implement certificate verification, and many other SSL-related
imrovements; complete details in the PR.

PR: kern/175514
Submitted by: Michael Gmelin <freebsd@grem.de>
MFC after: 1 week


# 50d675f7 28-Mar-2012 Eitan Adler <eadler@FreeBSD.org>

Remove trailing whitespace per mdoc lint warning

Disussed with: gavin
No objection from: doc
Approved by: joel
MFC after: 3 days


# 578153f1 19-Oct-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

latin1 -> utf8


# 6337341d 27-Sep-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Update copyright dates and strip my middle name.


# 76b94eb6 27-Sep-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Bump date.


# ecd18c96 27-Sep-2011 Dag-Erling Smørgrav <des@FreeBSD.org>

Think first, commit second.

1. Allow the caller to select active mode.
2. Fix the envar logic so it *always* overrides the caller's flags.
3. Document the change from active to passive.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# aae70d84 26-Jan-2010 Dag-Erling Smørgrav <des@FreeBSD.org>

insta-mfh r203028 (doc update)


# 78122aac 26-Jan-2010 Dag-Erling Smørgrav <des@FreeBSD.org>

Document HTTP digest authentication support.

Mention some prominent past contributors: Hajimu Umemoto (ipv6), Henry
Whincup (https), Jukka Ukkonen (if-modified-since) and Jean-François
Dockes (digest auth)


# 7f92799f 15-Dec-2008 Murray Stokely <murray@FreeBSD.org>

Add support for HTTP 1.1 If-Modified-Since behavior.

fetch(1) accepts a new argument -i <file> that if specified will cause
the file to be downloaded only if it is more recent than the mtime of
<file>.

libfetch(3) accepts the mtime in the url structure and a flag to
indicate when this behavior is desired.

PR: bin/87841
Submitted by: Jukka A. Ukkonen <jau@iki.fi> (partially)
Reviewed by: des, ru
MFC after: 3 weeks


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# e97f516c 08-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

s/MAXPATHLEN/PATH_MAX/ to reflect five-year old change to the code :)

Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de>
MFC after: 2 weeks


# e99ace35 18-Dec-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Document NO_PROXY / no_proxy.

MFC after: 3 weeks


# 887ecc8d 24-May-2007 Dag-Erling Smørgrav <des@FreeBSD.org>

Enable FTP_COMBINE_CWDS.


# f5e97105 22-Apr-2007 Nate Lawson <njl@FreeBSD.org>

Add back the original behavior of changing the entire directory path at
once (CWD a/b/c vs. 3 CWDs). If an error occurs, we fall back to the default
method of a single CWD per directory element. Since this is technically
a violation of the basic FTP RFC, this behavior is under a compile-time
option FTP_COMBINE_CWDS and is off by default. It should work with most
Unix-based FTP daemons and can save latency.

MFC after: 2 weeks


# 8d984020 29-Nov-2005 Tom McLaughlin <tmclaugh@FreeBSD.org>

Fix misspelling in Poul-Henning Kamp's email address under AUTHORS, from
pkh@ to phk@.

Approved by: ade


# 36a142c4 13-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Expand contractions.


# 0227791b 13-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Expand *n't contractions.


# 2cbbf9da 21-Sep-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Update copyright years.


# 1a0a9345 02-Jul-2004 Ruslan Ermilov <ru@FreeBSD.org>

Mechanically kill hard sentence breaks.


# 09e06539 25-Jan-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

I don't normally use my middle name, so remove it from attributions in
man pages (though not from copyright notices). While I'm here, add email
addresses where appropriate.


# fe08efe6 08-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7): Use the new feature of the .In macro.


# 0315901c 10-Jun-2003 Tom Rhodes <trhodes@FreeBSD.org>

Add an EXAMPLES section.

PR: 43899
Reviewed by: des, ru


# 3a5146d9 22-May-2003 Ruslan Ermilov <ru@FreeBSD.org>

Assorted mdoc(7) fixes.

Approved by: re (blanket)


# c42cb9d9 02-Mar-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Add and document support for a FETCH_BIND_ADDRESS environment variable
specifying a local address to bind sockets to. Caveat: lightly tested.

PR: bin/37572


# 0ab4a51e 22-Jan-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Document .netrc support.


# 57bd0fc6 26-Dec-2002 Jens Schweikhardt <schweikh@FreeBSD.org>

english(4) police.


# d5216a4f 27-Nov-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Implement and document support for an HTTP_REFERER environment variable.

PR: 28171
Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Approved by: re (bmah)
MFC after: 1 week


# d5c24aa8 08-Nov-2002 Bill Fenner <fenner@FreeBSD.org>

Fix two typos.


# 32eef9ae 01-Oct-2001 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: Use the new .In macro for #include statements.


# 7ebcc426 15-Jul-2001 Dima Dorfman <dd@FreeBSD.org>

Remove whitespace at EOL.


# 70d51341 09-Jul-2001 Dima Dorfman <dd@FreeBSD.org>

mdoc(7) police: remove extraneous .Pp before and/or after .Sh.


# a7e16a9d 05-Jul-2001 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: fixed markup and typo.


# 6a0cf64b 27-May-2001 Dag-Erling Smørgrav <des@FreeBSD.org>

Implement a HTTP_USER_AGENT environment variable.

PR: 27669
Submitted by: Eoin Lawless <eoin@maths.tcd.ie>


# 06b533d3 26-May-2001 Dag-Erling Smørgrav <des@FreeBSD.org>

Document the authentication callback interface.
Update RFC references (should have done that ages ago...)


# 38c7e4a6 23-Apr-2001 Archie Cobbs <archie@FreeBSD.org>

Apply 'const' liberally.

Fix some other minor glitches.


# 5e75e35c 15-Apr-2001 Dima Dorfman <dd@FreeBSD.org>

Grammar police: "its", not "it's", is the possessive form of "it".


# d5f175ce 23-Mar-2001 Dag-Erling Smørgrav <des@FreeBSD.org>

Use high port range by default, and replace the 'h' option with an 'l' option
that forces the ftp code to use the low (default) port range instead.


# 4cee73c8 06-Mar-2001 Dag-Erling Smørgrav <des@FreeBSD.org>

Support lower-case versions of the proxy environment variables.

PR: bin/25494


# 98849115 16-Jan-2001 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: fixed broken references.


# 32f6256a 16-Jan-2001 Ruslan Ermilov <ru@FreeBSD.org>

Prepare for mdoc(7)NG.


# c86c6f74 08-Jan-2001 Dag-Erling Smørgrav <des@FreeBSD.org>

The user name for anonymous ftp is now "anonymous".
Remove the period after the last man page reference.
Add a reference to RFC1635, and sort the RFC references by number.


# 659e0d5e 22-Dec-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Document FTP_LOGIN.


# 6c81eb52 06-Dec-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Somewhere along the line, I misunderstood the whole FTP_PASSIVE_MODE debate
and had libfetch selecting passive mode even when FTP_PASSIVE_MODE was not
set at all, which is really quite surprising unless you know about it. So
change it to the agreed default behaviour of selecting passive mode if
FTP_PASSIVE_MODE is set, but not "no".


# 79aad71d 01-Dec-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove some obsolete comments.


# 725ab628 22-Nov-2000 Ruslan Ermilov <ru@FreeBSD.org>

log


# b82f5db0 14-Nov-2000 Ruslan Ermilov <ru@FreeBSD.org>

Spell the des's name correctly.


# b5c508fb 14-Nov-2000 Ruslan Ermilov <ru@FreeBSD.org>

Use Fx macro wherever possible.


# 91c51046 28-Oct-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Document FTP_PASSIVE_MODE and FTP_PASSWORD.

PR: docs/20626
Submitted by: nik


# 1df2031c 12-Oct-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Document recent changes in URL parsing and proxy handling


# 89d755e1 12-Oct-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Make the ENVIRONMENT section more legible, and mention that HTTP_AUTH is
colon-separated.


# 2e83f638 31-Aug-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Document the FTP_PROXY and HTTP_PROXY variables better.


# e0a9ca38 21-Jul-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Document the proxy support better.


# 1a5faa10 17-Jul-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Introduce fetchXGet*(), which combine the functionalities of fetchGet*() and
fetchStat*(). In most cases, either fetchGet*() or fetchXGet*() is a wrapper
around the other; in all cases, calling fetchGet*() is identical to calling
fetchXGet*() with the second argument set to NULL.


# 98f5573f 12-Jul-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Fully document the HTTP authorization feature.
Update the BUGS section to reflect the HTTP rewrite.


# bc2a5e68 11-Jul-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Document that basic authorization now kinda works.


# 9a964d6a 25-May-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Add (and document) fetchMakeURL()


# ba101983 25-May-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Dump com_err, it's a stinking crock of shit.


# 40ac2845 15-May-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Document struct url.
Document the default values for fetchStat*().


# 9364c532 11-May-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Fix hard sentence break.

Submitted by: sheldonh


# 60245e42 11-May-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Reorganize some of the http code and split it into more functions.
Implement fetchStatHTTP().
Unbungle struct url, and add fetchFreeURL().
Document it.


# 0f5fcaa3 10-May-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Supply only one author name per instance of %A, as per mdoc.samples(7).

PR: 18465
Submitted by: Kazu TAKAMUNE <takamune@avrl.mei.co.jp>


# 15efcd39 22-Apr-2000 Alexey Zelkin <phantom@FreeBSD.org>

Introduce .Lb macro to libfetch manpage
Sort .Nm values
Change first column width in errors list (table look much better now)
Remove redundant comma


# c6ff3a1b 02-Mar-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


# f5f109a0 07-Jan-2000 Dag-Erling Smørgrav <des@FreeBSD.org>

Patches I've had lying around for several months:
* Add the 'h' ftp flag (allocate local port in high range)
* Add the 'd' flag (use direct connection even if proxy is defined)
* Make sure flags != NULL before calling strchr().
* Minor changes to some comments.


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# e7720fa8 05-Mar-1999 Bruce Evans <bde@FreeBSD.org>

Fixed prototype for fetchParseURL().


# ce71b736 21-Dec-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Implement and document file list retrieval.


# 5aea254f 16-Dec-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Implement and document fetchStatFTP.
Update description of struct url_stat in the man page.
Clean up error handling in ftp.c.


# 0fba3a00 16-Dec-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Add verbose flag, and support functions.
Brucify the Makefile.
Differentiate atime and mtime in fetch*Stat().
Fix a few pointer bugs.
Tweak some error messages.
Don't #include sys/param.h and stdio.h in fetch.h.
Document that sys/param.h and stdio.h must be #included before fetch.h.


# d8acd8dc 06-Nov-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Second of a series of cleanups to libfetch.

This commit introduces the following features:

a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.

b) the use of the com_err(3) facilities to report errors.

It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.

Changed files, in alphabetical order:

Makefile:
Don't generate macros in {ftp,http}err.c.

Generate category fields for the error message lists.

Compile the error table.

Install fetch_err.h along with fetch.h.

common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.

Add categories to the _netdb_errlist table.

Report errors through the Common Error library.

common.h:
Add the DEBUG macros.

Add prototype for fetchConnect().

Remove the prototype for _fetch_errstring(), which is local to common.c

Add a categroy field to struct fetcherr, and define constants for
error categories.

Define macros for _{url,netdb,ftp,http}_seterr().

errors.et: (new file)
List error categories.

fetch.3:
Document the fetchStat*() functions.

Move the "unimplemented functionality" comments from NOTES to BUGS.

Document that applications which use libfetch must also use
libcom_err, and list existing error codes.

Undocument fetchLastErr{Code,String}.

Remove the (empty) DIAGNOSTICS section.

Mention Eugene Skepner in the AUTHORS section.

fetch.c:
Move the DEBUG macros to common.c

Add fetchStat() and fetchStatURL().

Generate error messages for URL parser errors, and fix a minor bug
in the parser.

Use 'struct url' instead of 'url_t'.

Remove fetchLastErr{Code,String}.

fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.

Define struct url_stat (used by fetchStat()).

Add prototypes for fetchStat*().

Remove the declarations for fetchLastErr{Code,String}.

Include fetch_err.h.

fetch_err.et: (new file)
Error table for libfetch.

file.c:
Add fetchStatFile().

Use 'struct url' instead of 'url_t'.

ftp.c:
Add fetchStatFTP().

Use 'struct url' instead of 'url_t'.

Don't use fetchLastErrCode.

ftp.errors:
Add categories to all error messages.

http.c:
Add fetchStatHTTP().

Use 'struct url' instead of 'url_t'.

Don't use fetchLastErr{Code,Text}.

http.errors:
Add categories to all error messages.

Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner


# 842a95cc 05-Nov-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

First of a series of cleanups to libfetch. Changed files, in
alphabetical order:

Makefile:
Add common.c to SRCS.

Make debugging easier by making 'CFLAGS += -DNDEBUG' conditional on DEBUG

Don't declare struct {ftp,http}err in {ftp,http}err.c; use struct fetcherr
instead.

README:
Remove the todo list, which is out of date anyway.

common.c: (new file)
Gather utility functions in this file.

Merge the error reporting functions intp _fetch_errstring(),
_fetch_seterr() and _fetch_syserr().

Set fetchLastErrCode and fetchLastErrText appropriately when fetchConnect
fails.

common.h: (new file)
Gather internal prototypes and structures in this files.

fetch.3:
Undocument fetchFreeURL().

Document a few more known bugs.

Document fetchLastErrCode and fetchLastErrText.

fetch.c:
Add descriptive comments to all functions that lacked them.

Move fetchConnect() to common.c.

Obviate the need for fetchFreeURL(), and remove it.

fetch.h:
Modify struct url_t so the document part is at the end.

ftp.c:
Remove code that is duplicated elsewhere.

http.c:
Remove code that is duplicated elsewhere.

Prompted by: jkh


# db5f8ceb 26-Sep-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Bring the man page more or less up to date with the code.


# 4ca1ab94 09-Jul-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Imported libfetch into the tree. It compiles, but there's still some
work to do. I especially need help with the man page.