document https support, mentioning certificates are not validated, and obey

https_proxy.
This commit is contained in:
christos 2012-12-22 16:57:09 +00:00
parent 2c76bd3255
commit 057b4f79a5
5 changed files with 45 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmds.c,v 1.134 2012/01/15 20:43:24 christos Exp $ */
/* $NetBSD: cmds.c,v 1.135 2012/12/22 16:57:09 christos Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@ -96,7 +96,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
#else
__RCSID("$NetBSD: cmds.c,v 1.134 2012/01/15 20:43:24 christos Exp $");
__RCSID("$NetBSD: cmds.c,v 1.135 2012/12/22 16:57:09 christos Exp $");
#endif
#endif /* not lint */
@ -2675,7 +2675,7 @@ setoption(int argc, char *argv[])
return;
}
#define OPTIONINDENT ((int) sizeof("http_proxy"))
#define OPTIONINDENT ((int) sizeof("https_proxy"))
if (argc == 1) {
for (o = optiontab; o->name != NULL; o++) {
fprintf(ttyout, "%-*s\t%s\n", OPTIONINDENT,

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmdtab.c,v 1.51 2009/04/12 10:18:52 lukem Exp $ */
/* $NetBSD: cmdtab.c,v 1.52 2012/12/22 16:57:09 christos Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@ -63,7 +63,7 @@
#if 0
static char sccsid[] = "@(#)cmdtab.c 8.4 (Berkeley) 10/9/94";
#else
__RCSID("$NetBSD: cmdtab.c,v 1.51 2009/04/12 10:18:52 lukem Exp $");
__RCSID("$NetBSD: cmdtab.c,v 1.52 2012/12/22 16:57:09 christos Exp $");
#endif
#endif /* not lint */
@ -298,6 +298,7 @@ struct option optiontab[] = {
{ "anonpass", NULL },
{ "ftp_proxy", NULL },
{ "http_proxy", NULL },
{ "https_proxy",NULL },
{ "no_proxy", NULL },
{ "pager", NULL },
{ "prompt", NULL },

View File

@ -1,4 +1,4 @@
/* $NetBSD: fetch.c,v 1.199 2012/12/21 18:07:36 christos Exp $ */
/* $NetBSD: fetch.c,v 1.200 2012/12/22 16:57:09 christos Exp $ */
/*-
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: fetch.c,v 1.199 2012/12/21 18:07:36 christos Exp $");
__RCSID("$NetBSD: fetch.c,v 1.200 2012/12/22 16:57:09 christos Exp $");
#endif /* not lint */
/*
@ -482,7 +482,7 @@ sigjmp_buf httpabort;
/*
* Retrieve URL, via a proxy if necessary, using HTTP.
* If proxyenv is set, use that for the proxy, otherwise try ftp_proxy or
* http_proxy as appropriate.
* http_proxy/https_proxy as appropriate.
* Supports HTTP redirects.
* Returns 1 on failure, 0 on completed xfer, -1 if ftp connection
* is still open (e.g, ftp xfer with trailing /)
@ -625,7 +625,9 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
int hasleading;
if (proxyenv == NULL) {
if (IS_HTTP_TYPE(urltype))
if (urltype == HTTPS_URL_T)
proxyenv = getoptionvalue("https_proxy");
if (proxyenv == NULL && IS_HTTP_TYPE(urltype))
proxyenv = getoptionvalue("http_proxy");
else if (urltype == FTP_URL_T)
proxyenv = getoptionvalue("ftp_proxy");

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ftp.1,v 1.133 2012/04/08 22:00:38 wiz Exp $
.\" $NetBSD: ftp.1,v 1.134 2012/12/22 16:57:10 christos Exp $
.\"
.\" Copyright (c) 1996-2010 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -57,7 +57,7 @@
.\"
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
.\"
.Dd March 5, 2010
.Dd December 22, 2012
.Dt FTP 1
.Os
.Sh NAME
@ -1325,7 +1325,7 @@ and
.Ar value
are not given, display all of the options and their values.
The currently supported options are:
.Bl -tag -width "http_proxy" -offset indent
.Bl -tag -width "https_proxy" -offset indent
.It Cm anonpass
Defaults to
.Ev $FTPANONPASS
@ -1335,6 +1335,9 @@ Defaults to
.It Cm http_proxy
Defaults to
.Ev $http_proxy .
.It Cm https_proxy
Defaults to
.Ev $https_proxy .
.It Cm no_proxy
Defaults to
.Ev $no_proxy .
@ -1742,6 +1745,29 @@ and
(and optionally
.Sq password )
is in the URL, use them for the first attempt to authenticate.
.\" https://[user[:password]@]host[:port]/path
.It Li https:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
An
.Tn HTTPS
URL, retrieved using the
.Tn HTTPS
protocol.
If
.Ic "set https_proxy"
is defined, it is used as a URL to an
.Tn HTTPS
proxy server.
If
.Tn HTTPS
authorization is required to retrieve
.Ar path ,
and
.Sq user
(and optionally
.Sq password )
is in the URL, use them for the first attempt to authenticate.
There is currently no certificate validation and verification.
.\" file:///path
.It Li file:/// Ns Ar path
A local URL, copied from

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.121 2012/12/21 18:07:36 christos Exp $ */
/* $NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@ -98,7 +98,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
__RCSID("$NetBSD: main.c,v 1.121 2012/12/21 18:07:36 christos Exp $");
__RCSID("$NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp $");
#endif
#endif /* not lint */
@ -126,6 +126,7 @@ __RCSID("$NetBSD: main.c,v 1.121 2012/12/21 18:07:36 christos Exp $");
#define FTP_PROXY "ftp_proxy" /* env var with FTP proxy location */
#define HTTP_PROXY "http_proxy" /* env var with HTTP proxy location */
#define HTTPS_PROXY "https_proxy" /* env var with HTTPS proxy location */
#define NO_PROXY "no_proxy" /* env var with list of non-proxied
* hosts, comma or space separated */
@ -488,6 +489,7 @@ main(int volatile argc, char **volatile argv)
setupoption("anonpass", getenv("FTPANONPASS"), anonpass);
setupoption("ftp_proxy", getenv(FTP_PROXY), "");
setupoption("http_proxy", getenv(HTTP_PROXY), "");
setupoption("https_proxy", getenv(HTTPS_PROXY), "");
setupoption("no_proxy", getenv(NO_PROXY), "");
setupoption("pager", getenv("PAGER"), DEFAULTPAGER);
setupoption("prompt", getenv("FTPPROMPT"), DEFAULTPROMPT);