[M2Crypto] Problems uploading to IIS using FTP over SSL

  • Thread starter Stephen Nelson-Smith
  • Start date
S

Stephen Nelson-Smith

Hello,

System:

# rpm -q python m2crypto
python-2.4.3-27.el5
m2crypto-0.16-6.el5.6
# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 5.4 (Tikanga)

I have the following method:

def ftp_tarball(aggregation_dir, date_format, ftp_server, ftp_user,
ftp_pass):
date = datetime.today().strftime(date_format)
ftp = ftpslib.FTP_TLS()
ftp.connect(ftp_server)
ftp.auth_tls()
ftp.set_pasv(0)
ftp.login(ftp_user, ftp_pass)
filename = aggregation_dir + 'zultys-logs_' + date + '.tar.gz'
short_name = os.path.split(filename)[1]
tarball = open(filename, 'rb')
ftp.storbinary('STOR ' + short_name, tarball)
tarball.close()
ftp.quit()

This works perfectly with VSFTPD on Linux, with SSL forced for non-
anonymous users.

I try to connect to a supplier's IIS FTP server, and get:

Traceback (most recent call last):
File "/usr/local/bin/lumberjack", line 45, in ?
lumberjack.ftp_tarball( aggregation_dir, date_format, ftp_server,
ftp_user, ftp_pass )
File "/usr/lib64/python2.4/site-packages/lumberjack.py", line 93, in
ftp_tarball
ftp.storbinary('STOR ' + short_name, tarball)
File "/usr/lib64/python2.4/ftplib.py", line 415, in storbinary
conn = self.transfercmd(cmd)
File "/usr/lib64/python2.4/ftplib.py", line 345, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
File "/usr/lib64/python2.4/site-packages/M2Crypto/ftpslib.py", line
86, in ntransfercmd
conn, size = FTP.ntransfercmd(self, cmd, rest)
File "/usr/lib64/python2.4/ftplib.py", line 331, in ntransfercmd
sock = self.makeport()
File "/usr/lib64/python2.4/ftplib.py", line 292, in makeport
resp = self.sendport(host, port)
File "/usr/lib64/python2.4/ftplib.py", line 256, in sendport
return self.voidcmd(cmd)
File "/usr/lib64/python2.4/ftplib.py", line 246, in voidcmd
return self.voidresp()
File "/usr/lib64/python2.4/ftplib.py", line 221, in voidresp
resp = self.getresp()
File "/usr/lib64/python2.4/ftplib.py", line 216, in getresp
raise error_perm, resp
ftplib.error_perm: 501 Server cannot accept argument.

A colleague is able to connect using the Filezilla client, configured
as servertype: FTPES - FTP over explicit TLS/SSL setting.

I've not been able to find any further guidance on the web.

If you've experienced this before, or can see something that I've
obviously got wrong, I'd appreciate your help.

TIA,

S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top