cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problems with FTPS and WWW::Curl::Easy

From: Peter Heuchert <PHEUCH_at_de.ibm.com>
Date: Mon, 6 Feb 2006 18:04:22 +0100

Hello,

I tried to write a small Perl script using WWW::Curl::Easy that does
connect to a FTP server, encrypts the control connection and lists the
data. I can't get it to work. Using curl from command line is working
fine.

Here is the small script:

use WWW::Curl::Easy;
my $url = "ftp://192.109.81.6:21/";
$curl = WWW::Curl::Easy->new() or die "Can not create curl object";
open (BODY,">/tmp/listing");
$curl->setopt(CURLOPT_VERBOSE,1);
$curl->setopt(CURLOPT_URL,$url);
$curl->setopt(CURLOPT_FILE,*BODY);
$curl->setopt(CURLOPT_FTP_SSL,CURLFTPSSL_CONTROL);
$curl->setopt(CURLOPT_SSL_VERIFYPEER,0);
$curl->setopt(CURLOPT_SSL_VERIFYHOST,0);
if ( $curl->perform() != 0) {
  print "Failed::",$curl->errbuf,"\n";
}
close BODY;

The connection is done, but the AUTH TLS command is missing and the whole
conversation is done unencrypted.

Using the command line "curl -v --ftp-ssl --insecure ftp://192.109.81.6/"
is working as expected.

Any idea what is wrong ?

Regards
Peter Heuchert
Received on 2006-02-06