From a60618d7d5d6d0bcdda207ee8c7d09fc189d7f63 Mon Sep 17 00:00:00 2001 From: Hendrik Wolff Date: Mon, 1 Sep 2025 14:16:34 +0200 Subject: [PATCH] ftpd: Use implicit FTPS instead of explicit Implementation found in https://github.com/giampaolo/pyftpdlib/commit/edbc9ccaaac7beccd4a2c0ea5ffb56a9512ba02c Signed-off-by: Hendrik Wolff --- copyparty/ftpd.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/copyparty/ftpd.py b/copyparty/ftpd.py index a88a2757..0a63049f 100644 --- a/copyparty/ftpd.py +++ b/copyparty/ftpd.py @@ -564,6 +564,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 @@ -578,7 +588,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))