cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FTPS using lib-curl

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Fri, 3 Dec 2004 12:23:37 +0100 (CET)

On Fri, 3 Dec 2004, vamsi wrote:

> Does any one have a wroking example of how to perform FTPS over lib-curl?

No, but I can make one in 10 seconds:

int main(void)
{
   CURL *curl;
   CURLcode res;

   curl = curl_easy_init();
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "ftps://curl.haxx.se/");
     res = curl_easy_perform(curl);

     /* always cleanup */
     curl_easy_cleanup(curl);
   }
   return 0;
}

Although you may want to use a ftp:// URL and then simply use CURLOPT_FTP_SSL,
as that is the better way:
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTFTPSSL

> As asked in one of the Messages in the mailing list I used ftps in
> CURLOPT_URL but it is giving me Protocol not supported error.

Then you're using a too old libcurl or one that is built without SSL support.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-12-03