First a quick background: I am trying to make a very simple FTP over explicit TLS/SSL client. I have a dedicated ubuntu server (v11.10) with proftpd running on it. I am able to connect to the server to get files and whatnot through both FireFTP and Filezilla so I know that the server works fine. Here is my code:
from ftplib import FTP_TLS
print "Connecting to host..."
try:
ftps = FTP_TLS(host)
except:
print "Server not Found"
print "Logging in..."
try:
ftps.login(user,pw)
except:
print "Login failure!"
print "Securing connection..."
ftps.prot_p()
print "Retrieving contents..."
ftps.retrlines('LIST')
the variables host, user and pw are appropriately set earlier in the code. This is the error I get:
Connecting to host...
Logging in...
Securing connection...
Retrieving contents...
Traceback (most recent call last):
File "source.py", line 182, in <module>
signon(hostname,userid,pw)
File "source.py", line 80, in signon
ftps.retrlines('LIST')
File "/usr/lib/python2.7/ftplib.py", line 706, in retrlines
conn = self.transfercmd(cmd)
File "/usr/lib/python2.7/ftplib.py", line 368, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
File "/usr/lib/python2.7/ftplib.py", line 681, in ntransfercmd
conn, size = FTP.ntransfercmd(self, cmd, rest)
File "/usr/lib/python2.7/ftplib.py", line 327, in ntransfercmd
conn = socket.create_connection((host, port), self.timeout)
File "/usr/lib/python2.7/socket.py", line 571, in create_connection
raise err
socket.error: [Errno 113] No route to host
The only thing I have learned through googling is that there is a block somewhwere in the connection so here are some things I tried:
- Shut off firewalls on both client and server
- Create a filezilla server with TLS/SSL on a seperate desktop computer and connect to that (It connected and displayed the files without a problem)
- I ran a port scan on all systems to make sure the necessary ones are open (they are)
- I've tweaked the configuration files for proftpd with a few different TLSOptions but it made no difference
Any suggestions? Thanks in advance.

New Topic/Question
Reply



MultiQuote




|