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.