rusacarr has asked for the wisdom of the Perl Monks concerning the following question:

I am just a new apprentice, and need some advise.

I was pretty heavy into Perl in Unix a few years ago, and finally have the chance to do some real Perl programming again. Problem is that it is on Win2k, using ActivePerl. This has never been a problem until today.

I up/download files to clients daily through scripts I created using Net::FTP, but I have a new client who insists that we connect using Secure FTP. ( I have to have 128bit DES encryption) I have looked at Net::SFTP, but I can not satisfy the dependencies with ActivePerl. A lot of the modules needed are not ported with the needed versions. I've tried installing CPAN and running through the Makefile install, but I can't get anywhere. (A common gripe I've read in these postings)

I've found the list of needed modules on this site, but I have not been able to find ports of these modules for ActivePerl. Can I download all of them from CPAN and install manually? I've tried this for a few and was not successful. I've seen some of them depend on Unix libraries so I don't think I can install them. I'm not totally sure if the problem is that I can not install them, or if I just am not doing it right. I have nMake, but I'm not sure what compiler is required/used.

Moving to a Linux/Unix box is not really an option, getting the client to use something other than Secure FTP is not an option. I have to have some way to automate these transfers.

Any help for one seeking enlightenment?

Replies are listed 'Best First'.
Re: ActivePerl - Secure FTP - Net::SFTP?
by shenme (Priest) on Aug 12, 2003 at 23:13 UTC
    There are additional sites you can find PPM-installable modules. One that I use is Randy Kobes' site at http://theoryx5.uwinnipeg.ca/   He has some of the modules you need already created in a form ActivePerl's PPM utility understands.
    Packages available from http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver +?urn:/PPMServer: Net-SSH-Perl [1.23] Perl client Interface to SSH Net-SSH-W32Perl [0.05] Win32 (ActivePerl) Compatibility Layer for Net::SSH::Perl Packages available from http://ppm.ActiveState.com/cgibin/PPM/ppmserve +r.pl?urn:/PPMServer: Net-SSH [0.07] Perl extension for secure shell
    Depending on the ActivePerl version you have you would set PPM to use one of Randy's two PPM-package directories. I use the 6xx one, which you can add to PPM using:
    set repository RK http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver +?urn:/PPMServer
    I'm not sure the exact setting to use if you have a newer 8xx version of ActivePerl.

    You then do a search on, say, SSH and the above listing should appear. You may then do a normal "install Net-SSH-Perl". Having done this Net-SFTP (0.05) _will_ install, but the "make test" output looks skinnny. You'll have to tell us if it works. ;-o

Re: ActivePerl - Secure FTP - Net::SFTP?
by demerphq (Chancellor) on Aug 12, 2003 at 23:22 UTC

    Assuming you cant get Net::SFTP set up for some reason (im trying now and I think it will probably fail), then I would look into geting psftp to do the work for me and have the Perl script just play manager. If you code C then you may be happy to learn that the source looks pretty clean, and accordngly shouldnt be too hard to create a nicer interface to it.


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...
Re: ActivePerl - Secure FTP - Net::SFTP?
by iburrell (Chaplain) on Aug 13, 2003 at 00:46 UTC
    Check if they mean FTP over SSL or SFTP. SFTP is the SSH file transfer protocol. It is not FTP over SSH; it is a completely different protocol. Net::SFTP implements SFTP. They may mean FTP with TLS/SSL. The draft that describes this is http://www.ietf.org/internet-drafts/draft-murray-auth-ftp-ssl-11.txt As far as I know, Net::FTP does not support TLS, and there is no module doing TLS as an FTP client.
      Ah, yes, further proof that I am still learning.

      The client requests SSL FTP, not "Secure FTP". I was unaware that there was any true difference in the two. In fact, the little documentation the client offers me refers to RFC 2246, which you discussed. I'm currently scanning that now.

      Let me clear the air a little...I work for a Health Care billing agency, and, as anyone near the industry knows, we have new federal privacy/security standard we need to implement...aka HIPAA.

      HIPAA requires 128bit encryption for all electronic transfers. The client interpertes that to be SSL transfers, so that's what I have to run with.

      Hopefully, I'm not the only Perl programmer here in Health Care, and someone can share their knowledge/horror stories of how they are trying to support this stuff.

      I guess the question should now read: "I need a way to do FTP transfers over SSL and automate the process." I know there are other GUI clients that you can sort-of-script that can do this (WS-FTP), but we really need something with more flexability that we can control (like Perl). Any help out there, or do I have to goto low-level socket programming?

      Thanks,
      rusacarr

        Look at http://www.ford-hutchinson.com/~fh-1-pfh/ftps-ext.html for lots of info on FTP-SSL. It has a list of clients that support SSL, includng command-line clients that could be run from Perl.

        Also, you might want to investigate if FTP is the right solution. HTTPS is much simpler and better supported. It isn't ideal for transferring files it can be used for that. SSH and SFTP are also good for transferring and manipulating files securely.

        As a matter of fact, I'm in the same boat as you -- I'm in the Healthcare billing world too, and want to use Perl as an automated system to SSL-FTP claim data from the provider's site to our processing center. If you find a solution, let me know please?!

        Currently we're using Java to do all the work. And of course if it ain't broke... But then I think Perl could be a better solution.
Re: ActivePerl - Secure FTP - Net::SFTP?
by bean (Monk) on Aug 12, 2003 at 23:11 UTC
    Portable OpenSSH's sftp running in batch mode on cygwin? Not 100% pure Perl goodness, but you could use Perl to create batches, start sftp, and interpret the output. Here's a link.