This commit is contained in:
Hendrik Wolff 2026-01-11 06:25:07 +01:00 committed by GitHub
commit 5aafaae312
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -591,6 +591,16 @@ try:
class SftpHandler(FtpHandler, TLS_FTPHandler):
pass
class FtpsImplicitHandler(FtpHandler, TLS_FTPHandler):
def handle(self):
self.secure_connection(self.ssl_context)
def handle_ssl_established(self):
FtpHandler.handle(self)
def ftp_AUTH(self, arg):
self.respond("550 not supposed to be used with implicit SSL.")
except:
pass
@ -605,7 +615,7 @@ class Ftpd(object):
hs.append([FtpHandler, self.args.ftp])
if self.args.ftps:
try:
h1 = SftpHandler
h1 = FtpsImplicitHandler
except:
t = "\nftps requires pyopenssl;\nplease run the following:\n\n {} -m pip install --user pyopenssl\n"
print(t.format(pybin))