aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-07-26 23:20:47 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-07-26 23:20:47 +0000
commit4d4151f6c10c8770c70dd3b1d06a84ca5191142f (patch)
treec228d865275442bc1ac67420753ef3daa50905fa /src
parent518becfe2ea21a96e923149df45a433f2501e5fd (diff)
David McCreedy added --ftp-ssl-reqd which makes curl *require* SSL for both
control and data connection, as the existing --ftp-ssl option only requests it.
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index af20a396c..dd6920d5c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -338,6 +338,7 @@ struct Configurable {
struct timeval lastrecvtime;
size_t lastrecvsize;
bool ftp_ssl;
+ bool ftp_ssl_reqd;
char *socksproxy; /* set to server string */
int socksver; /* set to CURLPROXY_SOCKS* define */
@@ -516,7 +517,8 @@ static void help(void)
" --ftp-method [multicwd/nocwd/singlecwd] Control CWD usage (F)",
" --ftp-pasv Use PASV/EPSV instead of PORT (F)",
" --ftp-skip-pasv-ip Skip the IP address for PASV (F)\n"
- " --ftp-ssl Enable SSL/TLS for the ftp transfer (F)",
+ " --ftp-ssl Try SSL/TLS for the ftp transfer (F)",
+ " --ftp-ssl-reqd Require SSL/TLS for the ftp transfer (F)",
" -F/--form <name=content> Specify HTTP multipart POST data (H)",
" --form-string <name=string> Specify HTTP multipart POST data (H)",
" -g/--globoff Disable URL sequences and ranges using {} and []",
@@ -1342,6 +1344,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
{"$s", "local-port", TRUE},
{"$t", "socks4", TRUE},
{"$u", "ftp-alternative-to-user", TRUE},
+ {"$v", "ftp-ssl-reqd", FALSE},
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
@@ -1781,6 +1784,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
case 'u': /* --ftp-alternative-to-user */
GetStr(&config->ftp_alternative_to_user, nextarg);
break;
+ case 'v': /* --ftp-ssl-reqd */
+ config->ftp_ssl_reqd ^= TRUE;
+ break;
}
break;
case '#': /* --progress-bar */
@@ -3975,6 +3981,10 @@ operate(struct Configurable *config, int argc, char *argv[])
if(config->ftp_ssl)
curl_easy_setopt(curl, CURLOPT_FTP_SSL, CURLFTPSSL_TRY);
+ /* new in curl 7.15.5 */
+ if(config->ftp_ssl_reqd)
+ curl_easy_setopt(curl, CURLOPT_FTP_SSL, CURLFTPSSL_ALL);
+
/* new in curl 7.11.1, modified in 7.15.2 */
if(config->socksproxy) {
curl_easy_setopt(curl, CURLOPT_PROXY, config->socksproxy);