From 4d4151f6c10c8770c70dd3b1d06a84ca5191142f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 26 Jul 2006 23:20:47 +0000 Subject: 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. --- src/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.c') 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 Specify HTTP multipart POST data (H)", " --form-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); -- cgit v1.2.3