Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USE WWW::Curl::Easy

Status
Not open for further replies.

cdlvj

MIS
Nov 18, 2003
676
0
0
US
I cannot find any document on how the options map to the Perl Options.

The Curl command line is:

$ curl --ftp-ssl -sslv3 --verbose -E FITB-HSBC_public.pem --key FITB-HSBC_private.pem --pass pass --user Logon:xxx ftp://


Code:
use [URL unfurl="true"]WWW::Curl::Easy;[/URL]

my $site="ftp://[URL unfurl="true"]www.site.com/FR/outbound/FR_Test.txt";[/URL]
my $publickey="d:\\apps\\gkeys\\FITB-HSBC_public.pem";
my $privatekey="d:\\apps\\gkeys\\FITB-HSBC_private.pem";
my $pass="pass";

my $curl= new [URL unfurl="true"]WWW::Curl::Easy;[/URL]

### this should be OK
$curl->setopt(CURLOPT_URL, $site);
$curl->setopt(CURLOPT_FTP_SSL,TRUE);
$curl->setopt(CURLOPT_VERBOSE,TRUE);
$curl->setopt(CURLOPT_SSLKEY, $privatekey);
$curl->setopt(CURLOPT_SSLKEYPASSWD, $pass);

## not sure of this
## and the sslv3 option.
## found no option for user
## the --ftp-ssl should convert the ftp:// to a ssl connect.
$curl->setopt(CURLOPT_SSLCERT, $publickey);
$curl->perform;
my $err = $curl->errbuff;
my $info = $curl->getingo(CURLINFO_HTTP_CODE);
exit;
 
This is what I get.

D:\FTP\curl>perl curl.plx
* About to connect() to port 21
* Trying xxx.xx.xxx.xx... * connected
* Connected to (xxx.xx.xxx.x) port 21
< 220 xxx52:6021 FTP server (webMethods Integration Server version 6.5
) ready.
220 xxx52:6021 FTP server (webMethods Integration Server version 6.5)
ready.
> USER USER
< 331 Must authenticate first with the AUTH command.
331 Must authenticate first with the AUTH command.
> PASS pass
< 530 Must authenticate first with the AUTH command.
530 Must authenticate first with the AUTH command.
* Access denied: 530
* Closing connection #0
ERR:0
INFOCODE:530
INFOOPTION:43
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top