6 Replies - 3402 Views - Last Post: 20 July 2012 - 10:05 PM Rate Topic: -----

#1 cedricganon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-July 12

Error 113 No Route to host for ftp over TLS/SSL

Posted 18 July 2012 - 03:41 PM

Hello everyone,

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Error 113 No Route to host for ftp over TLS/SSL

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6076
  • View blog
  • Posts: 23,543
  • Joined: 23-August 08

Re: Error 113 No Route to host for ftp over TLS/SSL

Posted 18 July 2012 - 04:42 PM

What happens when you try to telnet to the host on the port you're trying to access?
Was This Post Helpful? 0
  • +
  • -

#3 cedricganon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-July 12

Re: Error 113 No Route to host for ftp over TLS/SSL

Posted 18 July 2012 - 04:55 PM

Thanks for the response. Telnet shows '220 FTP Server ready'. I typed in 'LIST' and it displayed: '550 SSL/TLS required on the control channel'. I don't know if that helps at all.
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6076
  • View blog
  • Posts: 23,543
  • Joined: 23-August 08

Re: Error 113 No Route to host for ftp over TLS/SSL

Posted 18 July 2012 - 06:12 PM

What port did you use, and are you sure the host is exactly the same as that you are passing as the host variable? It looks from the docs like you need to connect to port 21, at least initially. I'm not very well-versed in FTP over TLS.
Was This Post Helpful? 0
  • +
  • -

#5 cedricganon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-July 12

Re: Error 113 No Route to host for ftp over TLS/SSL

Posted 18 July 2012 - 06:40 PM

Yes I am connecting through port 21. The default for python is 21 so I didn't have to set that and the server accepts connections through 21. When I ran telnet I made sure to specify port 21. I also set up PASV ports through both the firewall and the server settings.
Was This Post Helpful? 0
  • +
  • -

#6 cedricganon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-July 12

Re: Error 113 No Route to host for ftp over TLS/SSL

Posted 18 July 2012 - 06:46 PM

Also the host variable is a dns so its consistent throughout
Was This Post Helpful? 0
  • +
  • -

#7 cedricganon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-July 12

Re: Error 113 No Route to host for ftp over TLS/SSL

Posted 20 July 2012 - 10:05 PM

bumping
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1