cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl command line tool ftp ssl control only

From: Mike Protts <mikep_at_proatria.com>
Date: Sat, 23 Sep 2006 17:14:37 +0100

I managed to quickly run this from home.

cvs diff: Diffing docs
Index: docs/curl.1
===================================================================
RCS file: /cvsroot/curl/curl/docs/curl.1,v
retrieving revision 1.190
diff -c -r1.190 curl.1
*** docs/curl.1 21 Sep 2006 22:15:05 -0000 1.190
--- docs/curl.1 23 Sep 2006 16:11:39 -0000
***************
*** 417,422 ****
--- 417,429 ----
  (Added in 7.11.0)

  If this option is used twice, the second will again disable this.
+ .IP "--ftp-ssl-control"
+ (FTP) Try SSL/TLS for the ftp login, clear for transfer.
+ Allows secure authentication, but non-encrypted data transfers for efficiency.
+ Reverts to a non-secure connection if the server doesn't support SSL/TLS.
+ (Added in 7.15.6)
+
+ If this option is used twice, the second will again disable this.
  .IP "--ftp-ssl-reqd"
  (FTP) Require SSL/TLS for the FTP connection.
  Terminates the connection if the server doesn't support SSL/TLS.

===================================================================

cvs diff: Diffing src
Index: src/main.c
===================================================================
RCS file: /cvsroot/curl/curl/src/main.c,v
retrieving revision 1.370
diff -c -r1.370 main.c
*** src/main.c 13 Sep 2006 01:35:28 -0000 1.370
--- src/main.c 23 Sep 2006 16:11:42 -0000
***************
*** 339,344 ****
--- 339,345 ----
    size_t lastrecvsize;
    bool ftp_ssl;
    bool ftp_ssl_reqd;
+ bool ftp_ssl_control;

    char *socksproxy; /* set to server string */
    int socksver; /* set to CURLPROXY_SOCKS* define */
***************
*** 519,524 ****
--- 520,526 ----
      " --ftp-pasv Use PASV/EPSV instead of PORT (F)",
      " --ftp-skip-pasv-ip Skip the IP address for PASV (F)\n"
      " --ftp-ssl Try SSL/TLS for the ftp transfer (F)",
+ " --ftp-ssl-control Try SSL/TLS for the ftp login, clear for 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)",
***************
*** 1351,1356 ****
--- 1353,1359 ----
      {"$u", "ftp-alternative-to-user", TRUE},
      {"$v", "ftp-ssl-reqd", FALSE},
      {"$w", "no-sessionid", FALSE},
+ {"$x", "ftp-ssl-control", FALSE},

      {"0", "http1.0", FALSE},
      {"1", "tlsv1", FALSE},
***************
*** 1801,1806 ****
--- 1804,1812 ----
        case 'w': /* --no-sessionid */
          config->disable_sessionid ^= TRUE;
          break;
+ case 'x': /* --ftp-ssl-control */
+ config->ftp_ssl_control ^= TRUE;
+ break;
        }
        break;
      case '#': /* --progress-bar */
***************
*** 3999,4004 ****
--- 4005,4014 ----
          if(config->ftp_ssl_reqd)
            curl_easy_setopt(curl, CURLOPT_FTP_SSL, CURLFTPSSL_ALL);

+ /* new in curl 7.15.6 */
+ if(config->ftp_ssl_control)
+ curl_easy_setopt(curl, CURLOPT_FTP_SSL, CURLFTPSSL_CONTROL);
+
          /* new in curl 7.11.1, modified in 7.15.2 */
          if(config->socksproxy) {
            curl_easy_setopt(curl, CURLOPT_PROXY, config->socksproxy);
cvs diff: Diffing src/macos

===================================================================

Plese let me know if anything else is needed.

Regards
Mike

On Sat, 23 Sep 2006 12:52:54 +0200 (CEST)
Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Fri, 22 Sep 2006, Mike Protts wrote:
>
> > I have a requirement to use ftp-ssl on the control channel only using the
> > curl command line tool. This is to allow encrypted logon and certificate
> > support, but using plain text transfers for performance reasons.
> >
> > I have chosen a new parameter -ftp-ssl-control to impliment this, and I
> > would be grateful if this can be considered for inclusion in a later
> > release. I have tried to conform to the existing coding conventions.
>
> It looks fine and I agree that the option is interesting to add.
>
> Can you please making it for the CVS version? It has changed somewhat and
> makes this patch not apply cleanly. And please add the new option and
> description to the docs/curl.1 man page as well!
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

-- 
Regards 
Mike Protts
Senior Technical Consultant
Pro:Atria Ltd
+44(0)870 765 6453
Received on 2006-09-23