I am trying to use below code to connect to FTP server over explicit TLS/SSL encryption. It fails at line 2 with error "ConnectionResetError: [Errno 104] Connection reset by peer". Has anyone else faced this? any suggestions on how to fix this?
Note- this fails at line 2 so not even able to connect to FTP server. I have seen some posts where this similar error message shows up while uploading file but this error is different in my opinion.
from ftplib import FTP_TLS
ftps = FTP_TLS('ftp.MySite.com')
# login after securing control channel
ftps.login('testuser', 'testpass')
ftps.prot_p()
ftps.retrlines('LIST')
ftps.close()