Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'm developing a program to download some files from a vendor site. The site uses FTP with SSL. I can connect but my data connections are dropped. I think that the module is not allowing encryption on the data channel. I tested with lftp and my data connections (e.g. and ls command) only worked after I enable encryption on the data channel. Yes, the ls returns files and directories.

#!/usr/bin/perl use strict; use warnings; use Net::FTPSSL; my $server = "ftps.example.com"; my $username = "*********"; my $passwd = "**********"; my @ret; my $ftps = Net::FTPSSL->new( $server, Debug => 1) or error("Cannot reach $server"); $ftps->login($username, $passwd) or error("Credential error, $ftps->last_message"); @ret = $ftps->list() or error("Command error, $ftps->last_message"); $ftps->pwd(); print @ret;
Sample output:

>>> USER ******** <<< 331 Password required for ********. >>> PASS ******** <<< 230 User ******* logged in. >>> PBSZ 0 <<< 200 PBSZ Command successful. >>> PROT P <<< 200 PROT Command successful. >>> PASV <<< 227 Entering Passive Mode (**************) >>> LIST <<< 150 Opening data connection for '/bin/ls'. <<< 226 Transfer complete. >>> PWD <<< 257 "/home/*******" is current directory.

Neil Watson
watson-wilson.ca


In reply to Net::FTPSSL and encrypted data connection by neilwatson

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-24 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found