<div dir="ltr"><div>If you've done this in Perl before, I'd try that. Net::FTP has hooks for SSL. You add the appropriate SSL options to the constructor and everything else works the same. You also might want to check if the connection uses SSL from the get-go or if it expects "starttls" after a initial un-encrypted connection. <br></div><div><br></div><div>HTH</div><div><br></div><div>Jeff<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 3, 2018 at 2:56 PM Lightner, Jeffrey via Ale <<a href="mailto:ale@ale.org">ale@ale.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-3894271949478779238WordSection1">
<p class="MsoNormal">We have a new partner insisting they can only accept ftps (i.e. no sftp) logins for us to download files from their site.<br>
<br>
I had found some time ago that the tool lftp can be used to login to ftps sites and had worked out a syntax that worked for one vendor.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">On trying that syntax on this site it doesn’t work. I found an alternate syntax on RedHat’s site and that worked for me (once) on 16-Nov to actually download files.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">However, ever since then every time I try the newer syntax it fails. Worse yet they lock the vendor is locking the account after 3 failed password attempts (which they says is the only reason) so every time I try this syntax the account
is getting locked and I have to wait for them to unlock it. Prior to running the syntax just doing a simple login works but of course doesn’t afterwards. It appears the way lftp works is that even though one gives it the user/login at start it is actually
logging in separately for each command it runs.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The basic command syntax here logs in successfully (until the account gets locked):<u></u><u></u></p>
<p class="MsoNormal">lftp -d -u <USER>,<PASSWORD> <ftpssite><br>
<br>
That puts me at an lftp prompt. At that prompt I can send commands to change directory, list files, and even change the password. However, if I try a “get <file>” it just times out and retries over and over.<br>
<br>
The syntax (one liner) that worked for me on 16-Nov that now fails:<u></u><u></u></p>
<p class="MsoNormal">lftp -v -c 'open -e "set ftps:initial-prot """; set ftp:ssl-force true; set ftp:ssl-protect-data true; set ssl:verify-certificate false; open ftps://<USER>:<PASSWORD>@<ftpssite>; ls; cd outbound/<subdir>; ls; get <filename>'<br>
<br>
I had later found things such as specifying port and also that the “set ftp:inititial-prot” was unsupported (I’d seen an error in output using it even though it had been successful downloading.) I’d added the port option and removed the unsupported option
that same day and they had worked but later in day the account was locked so further testing failed. After having partner unlock I did additional testing but eventually it gets locked so I’ve never yet been able to download a file despite initial connections
being successful.<br>
<br>
Every time partner unlocks the account the basic login works:<br>
lftp -d -u <USER>,<PASSWORD> <ftpssite><br>
<br>
<u></u><u></u></p>
<p class="MsoNormal">But every time I try to use the expanded syntax the account gets locked again. I can see it is showing failed login multiple times in the output but don’t know why it is doing that now when it worked previously.<br>
<br>
I need to be able to script this so that we can login to the server with the user and password to see what files, if any, are available to download, then download the ones found. This kind of operation is something I’ve done in the past with regular here
docs for regular ftp and with perl with ftp as well as scripts for sftp.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Does anyone have syntax that works for similar purposes that would be willing to share? I’m not married to the idea of lftp – that is just what I find suggested in most posts. Is there a way to do it with wget? curl? Some other CLI
tool?<br>
<br>
Remote only supports ftps – please don’t suggest sftp as that is simply not an option.<u></u><u></u></p>
</div>
<p style="font-size:10pt;line-height:10pt;font-family:'Arial','times roman',serif">
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information
is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you
</p>
<span>
<p></p>
</span><br>
<br>
<div></div>
</div>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="https://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">https://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div>