From 970722483cfc226d5a3da13f05795fdfa7b31ebf Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 28 Mar 2005 22:17:49 +0000 Subject: [PATCH] Added --proxy-anyauth --- docs/curl.1 | 9 ++++++++- src/main.c | 12 ++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/curl.1 b/docs/curl.1 index f216db68f..fb845913c 100644 --- a/docs/curl.1 +++ b/docs/curl.1 @@ -21,7 +21,7 @@ .\" * $Id$ .\" ************************************************************************** .\" -.TH curl 1 "25 Jan 2005" "Curl 7.13.0" "Curl Manual" +.TH curl 1 "29 Mar 2005" "Curl 7.13.2" "Curl Manual" .SH NAME curl \- transfer a URL .SH SYNOPSIS @@ -647,6 +647,13 @@ You may use this option as many times as you have number of URLs. (SSL) Pass phrase for the private key If this option is used several times, the last one will be used. +.IP "--proxy-anyauth" +Tells curl to pick a suitable authentication method when communicating with +the given proxy. This will cause an extra request/response round-trip. Added +in curl 7.13.2. + +If this option is used twice, the second will again disable the proxy use-any +authentication. .IP "--proxy-basic" Tells curl to use HTTP Basic authentication when communicating with the given proxy. Use \fI--basic\fP for enabling HTTP Basic with a remote host. Basic is diff --git a/src/main.c b/src/main.c index 298d40153..4df0c6919 100644 --- a/src/main.c +++ b/src/main.c @@ -383,6 +383,7 @@ static void help(void) " -o/--output Write output to instead of stdout", " -O/--remote-name Write output to a file named as the remote file", " -p/--proxytunnel Operate through a HTTP proxy tunnel (using CONNECT)", + " --proxy-anyauth Let curl pick proxy authentication method (H)", " --proxy-basic Enable Basic authentication on the proxy (H)", " --proxy-digest Enable Digest authentication on the proxy (H)", " --proxy-ntlm Enable NTLM authentication on the proxy (H)", @@ -512,6 +513,7 @@ struct Configurable { bool proxyntlm; bool proxydigest; bool proxybasic; + bool proxyanyauth; char *writeout; /* %-styled format string to output */ bool writeenv; /* write results to environment, if available */ FILE *errors; /* if stderr redirect is requested */ @@ -1257,6 +1259,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ {"$k", "3p-user", TRUE}, {"$l", "3p-quote", TRUE}, {"$m", "ftp-account", TRUE}, + {"$n", "proxy-anyauth", FALSE}, {"0", "http1.0", FALSE}, {"1", "tlsv1", FALSE}, @@ -1641,9 +1644,12 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ case 'm': /* --ftp-account */ GetStr(&config->ftp_account, nextarg); break; + case 'n': /* --proxy-anyauth */ + config->proxyanyauth ^= TRUE; + break; } break; - case '#': /* added 19990617 larsa */ + case '#': /* --progress-bar */ config->progressmode ^= CURL_PROGRESS_BAR; break; case '0': @@ -3650,7 +3656,9 @@ operate(struct Configurable *config, int argc, char *argv[]) /* new in curl 7.10.7 */ curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, config->ftp_create_dirs); - if(config->proxyntlm) + if(config->proxyanyauth) + curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY); + else if(config->proxyntlm) curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_NTLM); else if(config->proxydigest) curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_DIGEST);