0

I am using ftpretty library to connect to an FTP server. Here is the piece of code.

from ftpretty import ftpretty
print("Establishing connection")
ftpclient = ftpretty(host,username,password,secure=False,timeout=60)
folderitems = ftpclient.list('/')
print("Connection successfully established")
print("Items in directory: "+str(folderitems))

When I use secure as false, It gives this error: error_perm: 530 Non-anonymous sessions must use encryption.

However, when I use secure=True, It raises a timeout exception. I tried by increasing timeout to 5-10 minutes. Still the same issue:

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I even tried using native FTP library FTPLIB as mentioned in this SO post: FTPES - FTP over explicit TLS/SSL in Python

Still facing the same issue.

Paulie-C
  • 1,674
  • 1
  • 13
  • 29
  • Here is the Debug Log: https://www.notion.so/FTP-TLS-ERROR-3711e9eab540421f922444a3cb4a9d46 – Shakir Shakeel Mar 19 '20 at 10:07
  • Yes i can do that. – Shakir Shakeel Mar 19 '20 at 10:53
  • @MartinPrikryl Here us the Logfile generated By WinSCP. By Checking the Log file, I guess using Passive mode, the server returns the internal private IP which is not accessible to the public. Then WinSCP automatically switched back to the actual host address Is that right? – Shakir Shakeel Mar 19 '20 at 11:17

0 Answers0