You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Connecting to Bambu Labs X1C ftps server, which appears to be running vsFTPd 3.0.3 based on the welcome message, get an error unexpected exception occurred: 522 SSL connection failed: session reuse required when attempting to do something simple like ftps_client.list_files("/"). Trying to upload a file I get unexpected exception occurred: EOF occurred in violation of protocol (_ssl.c:2426)
To Reproduce
Steps to reproduce the behavior:
Used this code to connect and attempt to list and upload file.
Expected behavior
To be able to list and upload files.
Screenshots
Additional context
I'm able to connect and list/upload files using filezilla ftp client as described in the link below without issue, so know the login information is correct.
I think I may have found a fix for this use case from this stack overflow post. But applying the ntransfercmd patch seems to have broke the storbinary one. This is what I ended up with.
classImplicitTLS(ftplib.FTP_TLS):
"""ftplib.FTP_TLS sub-class to support implicit SSL FTPS"""def__init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._sock=None@propertydefsock(self):
"""return socket"""returnself._sock@sock.setterdefsock(self, value):
"""wrap and set SSL socket"""ifvalueisnotNoneandnotisinstance(value, ssl.SSLSocket):
value=self.context.wrap_socket(value)
self._sock=valuedefntransfercmd(self, cmd, rest=None):
conn, size=ftplib.FTP.ntransfercmd(self, cmd, rest)
ifself._prot_p:
conn=self.context.wrap_socket(conn,
server_hostname=self.host,
session=self.sock.session) # this is the fixreturnconn, size
Describe the bug
Connecting to Bambu Labs X1C ftps server, which appears to be running vsFTPd 3.0.3 based on the welcome message, get an error
unexpected exception occurred: 522 SSL connection failed: session reuse required
when attempting to do something simple likeftps_client.list_files("/")
. Trying to upload a file I getunexpected exception occurred: EOF occurred in violation of protocol (_ssl.c:2426)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
To be able to list and upload files.
Screenshots

Additional context
I'm able to connect and list/upload files using filezilla ftp client as described in the link below without issue, so know the login information is correct.
https://forum.bambulab.com/t/we-can-now-connect-to-ftp-on-the-p1p/6464
The text was updated successfully, but these errors were encountered: